Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is possible in Twisted, using inline callbacks:

  try:
      data = doManyFancyThingsWith(yield asyncResult())
      print 'Parsed data:', data
  except:
      print 'Oh no, something went wrong!'
I find that I use inline callbacks for the common case and work with deferreds directly only when it makes more sense to handle callbacks explicitly.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: