mwasilak / txThings

CoAP library for Twisted
94 stars 43 forks source link

Integrating txthings with a client #3

Closed erbdex closed 8 years ago

erbdex commented 9 years ago

Excuse my being new to the reactor way of things, but how does one go about making say 200 CoAP requests using txthings library? Specifically- do i run and stop reactor after every request? I get a feeling that this isn't the way to go as the overhead of starting stopping the reactor thread with every request will be fairly massive.

mwasilak commented 8 years ago

TxThings is based on Twisted framework, which is an asynchronous I/O framework. Async frameworks require that software using them is written in a particular, non-blocking way. The reactor is an event loop, and should be a main loop of your program. The advantage of using event loop is that requests are not blocking - you can make 200 requests simultaneously.