Please clarify some things about Pulsar

63 views
Skip to first unread message

Rokas K.

unread,
Jul 26, 2017, 3:33:10 AM7/26/17
to python-pulsar
Hello,
I discovered Pulsar just yesterday and it seems to fit my requirements like a glove. Or almost like a glove. Let me detail what i need and please advice/correct my misconceptions if any.

I need:
  • Framework that runs on greenlets.
  • Framework that can integrate with django.
  • Websockets on django and on standalone application.
  • Serve django requests asynchronously. Ideally django request should run in a greenlet and i should be able to yield execution while waiting on json-rpc response.
  • Run multiple servers from one process (tcp, udp, websockets, http/django).
  • Run multiple clients from one process (tcp, udp, websockets).
  • Framework that allows me to yield from arbitrary code location (implicit concurrency like greenlets, not explicit concurrency like asyncio).

I am not sure if Pulsar can handle last requirement. Can it? From going through docs it appears that all other requirements can be handled.


My current setup is a mix of gevent, aiohttp and django.It is not ideal for several reasons though. On server aiohttp runs on gevent loop and passes all requests to django, except requests to websockets. On client aiohttp runs on gevent and connects to django websocket. Can Pulsar help me simplify this setup?


One exceptional usecase is client handling remote python module imports. Python importer is called synchronously however, but it still has to wait for network communication to complete and return remote python module code. This is the reason for last item in the list above. I think if import is invoked from within a greenlet then code that handles import could yield execution and wait until data is sent over the network. Is this viable with Pulsar?


Thank you in advance

lsbardel

unread,
Aug 5, 2017, 12:56:09 PM8/5/17
to python-pulsar
Hi,


On Wednesday, July 26, 2017 at 8:33:10 AM UTC+1, Rokas K. wrote:
Hello,
I discovered Pulsar just yesterday and it seems to fit my requirements like a glove. Or almost like a glove. Let me detail what i need and please advice/correct my misconceptions if any.

I need:
  • Framework that runs on greenlets.
yes, pulsar can use greenlets for implicit asynchronous code 
  • Framework that can integrate with django.
yes, you can do that, see https://github.com/quantmind/pulsar-django for example 
  • Websockets on django and on standalone application.
yes, see above example or other examples in pulsar 
  • Serve django requests asynchronously. Ideally django request should run in a greenlet and i should be able to yield execution while waiting on json-rpc response.
yes, you can use the GreenWSGI middleware from greenio.wsgi module for example
  • Run multiple servers from one process (tcp, udp, websockets, http/django).
yes 
  • Run multiple clients from one process (tcp, udp, websockets).
 not sure what you mean for running clients
  • Framework that allows me to yield from arbitrary code location (implicit concurrency like greenlets, not explicit concurrency like asyncio).
yes, you can mix and match, but it requires a good knowledge of pulsar internals
  

I am not sure if Pulsar can handle last requirement. Can it? From going through docs it appears that all other requirements can be handled.


My current setup is a mix of gevent, aiohttp and django.It is not ideal for several reasons though. On server aiohttp runs on gevent loop and passes all requests to django, except requests to websockets. On client aiohttp runs on gevent and connects to django websocket. Can Pulsar help me simplify this setup?


One exceptional usecase is client handling remote python module imports. Python importer is called synchronously however, but it still has to wait for network communication to complete and return remote python module code. This is the reason for last item in the list above. I think if import is invoked from within a greenlet then code that handles import could yield execution and wait until data is sent over the network. Is this viable with Pulsar?


what you mean for remote python modules? how do you import these modules, via http?
 
Reply all
Reply to author
Forward
0 new messages