Open derfenix opened 6 years ago
aiozmq isn't intended for use in synchronous apps, but it should be possible to make async functions blocking by wrapping them in e.g. asyncio.run
.
I just meen if there any sync client uses the same messages format? I need to connect to rpc server on aiozmq.rpc from django app. So I need to choose - use aiozmq.rpc or use other package with ready sync clients.
@akhilman Thanks, looks nice, but I've created a more simple version already, containing only client in one file. Just rewrite async version without async. May be this will be usefull for somebody else. https://gist.github.com/derfenix/f18e4a8f0ee9bad738c2b22106a3ad4d
@derfenix thank you. I did my own non asyncio client using your code.
https://gist.github.com/akhilman/6f4aa516a7317f36ebac427a9d392865
My client produces futures and doesn't block process until result()
method called.
It looks like:
futures = [rpc.method_one(), rpc.method_two()]
result_one, result_two = [fut.result() for fut in futures]
@akhilman Hello, thank you very much for the code example. Would you have an up to date version on hand or the will to actually publish this as a package, so we could maintain it ?
Thank you !
Is there any way to make sync client to communicate aiozmq.rpc server? I meen any solution ready to use.