[Twisted-Python] DeferredSemaphore - action on acquire and release

Stephen Thorne stephen at thorne.id.au
Mon Feb 7 21:22:05 MST 2011


On 2011-02-08, Jason Heeris wrote:
> On 8 February 2011 11:46, Stephen Thorne <stephen at thorne.id.au> wrote:
> > Um, that's what I mean, you shouldn't be using .acquire() or .release(),
> > just .run(). doSerialStuff doesn't need a reference to the semaphore
> > object.
> 
> So... how can I update the property and emit the signal upon
> acquisition and release? Or are you saying I should stick with what I
> had?

I totally misread your example, and I appologise. I've read it now and
it looks fine to me. The only commend I'd make is that you probably want
DeferredLock not DeferredSempahore if this is serialised access.

-- 
Regards,
Stephen Thorne
Development Engineer
Netbox Blue




More information about the Twisted-Python mailing list