Twisted for non-networking applications

RajNewbie raj.indian.08 at gmail.com
Mon Dec 22 00:25:10 EST 2008


On Dec 22, 3:26 am, "James Mills" <prolo... at shortcircuit.net.au>
wrote:
> On Mon, Dec 22, 2008 at 4:27 AM, Kottiyath <n.kottiy... at gmail.com> wrote:
> > Hi all,
> >   Is it a good idea to use Twisted inside my application, even though
> > it has no networking part in it?
> >   Basically, my application needs lots of parallel processing - but I
> > am rather averse to using threads - due to myraid issues it can cause.
> > So, I was hoping to use a reactor pattern to avoid the threads. I am
> > using twisted in another part of the application for networking, so I
> > was hoping to use the same for the non-networking part for reusing the
> > reactor pattern.
> >   If somebody can help me on this, it would be very helpful.
>
> Alternatively you could give circuits (1)
> a go. It _can_ be a nice alternative to
> Twisted and isn't necessarily focused on
> Networking applications.
>
> cheers
> James
>
> 1.http://trac.softcircuit.com.au/circuits/

I was unable to see documentation explaining this - so asking again.
Suppose the event handlers in the component is doing blocking work,
how is it handled?
I went through ciruits.core, but was unable to understand exactly how
blocking mechanisms are handled.
My scenario is as follows:
I have 4 loops, 1 small and high priority, 3 quite large and blocking
(takes upto 3 seconds) and comparatively low priority.
The small loops goes through everytime and does some work - and
optionally uses the data sent by the other 3 loops.
I do not want the smaller loop to get blocked by the other loops.

So, if the event handler does blocking work, can that cause the whole
loop to block?



More information about the Python-list mailing list