Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for asyncio #14

Open
abalkin opened this issue Nov 12, 2017 · 3 comments
Open

Add support for asyncio #14

abalkin opened this issue Nov 12, 2017 · 3 comments

Comments

@abalkin
Copy link
Contributor

abalkin commented Nov 12, 2017

It should be possible to implement an asyncio event loop based on kdb+ sd1/sd0. Once such an event loop is available, it should be straightforward to implement asynchronous calls from q to Python.

@jfakx
Copy link
Contributor

jfakx commented Nov 18, 2017

so if a message came in on .z.ps, how might code look from handling that message to returning a response - using asyncio?

@abalkin
Copy link
Contributor Author

abalkin commented Nov 18, 2017

You can see some simple examples in the Python Manual. Ideally something like

p)async def hello_world(x):'
    await asyncio.sleep(10)
    print("Hello World!")
.z.ps:.p.callable .p.pyeval"hello_world"

would result in "Hello World!" printed on the server console 10 seconds after each client message, but will not block the client.

@mittonsimon
Copy link

@jhanna-kx @jfakx - Is there any way to expose the sd1/sd0 handlers like in C so that python can run threaded work and push results back into the Q session?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants