Skip to content

Better support of async by handling deferred #129

Open

Description

@aarcro

As a plugin developer
I want to return deferred objects from plugin methods
So that I can easily unit test such methods

I think what is needed is for plugins.core.Registry.process to handle twisted.internet.defer.Deferred objects, rather than (or in addition too) catching ResponseNotReady. It should break if first_responder and continue otherwise. (I think this is a bug in the current implementation, ResponseNotReady breaks without considering first_responder).

Also a callback could be added to the Deferred to write the output to channel and update last_message (this currently happens in Client.privmsg though, not sure if you want to filter Deferreds out of the returned responses there though)

Activity

  1. added this to the v2 milestone on Dec 30, 2014
  2. shaunduncan commented on Dec 30, 2014

    @shaunduncan
    Owner

    I think I'm definitely +1 on this for helga 2.0. It will certainly simplify implementations. I think I'll prefer just returning deferred objects rather than handling ResopnseNotReady in 2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions