[Twisted-Python] DeferredList failure accumulation
![](https://secure.gravatar.com/avatar/2f626ca5650f292f76a9513531228a45.jpg?s=120&d=mm&r=g)
I've been doing a lot with DeferredList's lately and just want to make sure I'm doing things the "right" way. There a couple different situations where I want to report errors in Deferred's that are added to a DeferredList. 1) I define a remote_status method on the PB client that initiates the request. The PB server calls the remote_status method on the client to update the status for the particular task and redisplay the grid below, and if the status if a failure, passes the failure as an argument which gets added to an overall list of failures that are displayed nicely when all tasks are complete. | 1 | 2 | 3 | 4 | status ---------------------------------- job1 | S | S | S | S | success ---------------------------------- job2 | S | F | S | F | failure ---------------------------------- Failures ---------------------------------- Task: job2 Step: step2 Failure: blah blah blah Task: job2 Step: step4 Failure: blah blah blah 2) If the DeferredList is used in a general class that represents some data type worked on by the PB server, have each Deferred have an errback that adds its errors into a list of errors. Then add a callback to the entire DeferredList that checks to see if there are any accumulated failures. If it finds failures, it errback's with a list of the failure objects represented as strings so we don't have to deal with InsecureJelly problems. Does this sound like an alright way to do this? Anyone have any suggestions at improving this? Thanks. -Justin
participants (1)
-
Justin Johnson