Currently we require any opened database to be closed and reopened before service TP queries.
However, for those users which simply open a large database for serving TP queries, the close and reopen is not necessary.
Could we provide some interface on python client like
from neug import load_and_serve
server = load_and_serve(
db_path="/path/to/database",
host="127.0.0.1",
port=10000,
blocking=False,
max_thread_num=0,
thread_num=0,
buffer_strategy="M_FULL",
)
print(server.endpoint)
server.stop()
Which returns a Server handle.
class DatabaseServer:
@property
def endpoint(self):
...
def stop(self):
...
def close(self):
...
def __enter__(self):
return self
def __exit__(self, exc_type, exc, tb):
self.close()
We could also let Database.serve() return the same handle.
Currently we require any opened database to be closed and reopened before service TP queries.
neug/tools/python_bind/src/py_database.cc
Line 124 in 29d7c29
However, for those users which simply open a large database for serving TP queries, the close and reopen is not necessary.
Could we provide some interface on python client like
Which returns a Server handle.
We could also let
Database.serve()return the same handle.