Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-14 Thread Tobias Oberstein
Am 11.07.19 um 23:34 schrieb Sean DiZazzo: Klein and Crossbar.io seem relevant as well https://crossbario.com/blog/Going-Asynchronous-from-Flask-to-Twisted-Klein/ yeah, klein is neat! fwiw, this might also be of interest, as it allows to scale-up twisted web (and hence also klein) on multi-c

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-13 Thread Waqar Khan
Hi, Thank you all for your kind response. So, I am trying to use treq library import treq @defer.inlinecallbacks def long_computation(rec_type, data): # some long computation *defer.returnValue(recs)* @defer.inlinecallbacks def fetch_data(user_id): r = yield treq.get('url/t

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-12 Thread Tom Most
On Thu, Jul 11, 2019, at 1:46 AM, Scott, Barry wrote: > On Tuesday, 9 July 2019 22:04:11 BST Tom Most wrote: > > ...snip... > > > The reactor's own thread pool is really for DNS resolution. > > Is that still true in the default case? We are use the twisted code that > talks > to DNS servers as

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-11 Thread Sean DiZazzo
Klein and Crossbar.io seem relevant as well https://crossbario.com/blog/Going-Asynchronous-from-Flask-to-Twisted-Klein/ On Thu, Jul 11, 2019 at 1:46 AM Scott, Barry wrote: > On Tuesday, 9 July 2019 22:04:11 BST Tom Most wrote: > > ...snip... > > > The reactor's own thread pool is really for DNS

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-11 Thread Scott, Barry
On Tuesday, 9 July 2019 22:04:11 BST Tom Most wrote: ...snip... > The reactor's own thread pool is really for DNS > resolution. Is that still true in the default case? We are use the twisted code that talks to DNS servers as the threaded resolver adds too much latency. > You risk deadlocks in

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-07-09 Thread Tom Most
Hi, There are likely a few things wrong here. 1. You are using requests.get() to make a HTTP request. This is blocking. You might consider using Twisted's Agent API instead (or treq

Re: [Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-06-25 Thread Waqar Khan
Sorry I had a typo in twisted program @defer.inlinecallbacks def long_computation(rec_type, data): # some long computation *defer.returnValue(recs)* @defer.inlinecallbacks def fetch_data(user_id): r = yieldjson.loads(requests.get('url/to/fetch/%s'%user_id).text) defer.retu

[Twisted-Python] Twisted tips for designing highly concurrent twisted REST API

2019-06-25 Thread Waqar Khan
Hello folks, I recently stumbled upon twisted and was wondering if it could suit my needs. On one hand, I want to use python but on another hand there are all these scalability concerns with this language so, I though I would pick the brains of the community. So.. a flask based app would look som