Changes between and of Initial VersionVersion 1Ticket #4620


Ignore:
Timestamp:
08/01/2010 10:36:03 PM (9 years ago)
Author:
Jean-Paul Calderone
Comment:

Changing ticket description to something resolveable.

Also changing assignment, as I have no near-term plans to work on this.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #4620

    • Property Owner changed from Jean-Paul Calderone to reiven
    • Property Milestone changed from Python-2.6 to
    • Property Summary changed from whois is not returning data to Introduce an IRC client API with data retrieval APIs which return Deferreds
  • Ticket #4620 – Description

    initial v1  
    1 t.w.p.i.ircclient whois function is not returning any information, it just send data to the server
     1The present IRC client API, `twisted.words.protocols.irc.IRCClient`, exposes a number of methods for retrieving data from an IRC server.  However, these methods all operate by sending the necessary request bytes and then expecting the application developer to override the necessary methods to learn when the response arrives.
     2
     3This is significantly less convenient than APIs which return Deferreds which fire with the result, as it is more in line with other client APIs in Twisted, avoids the need for the application developer to subclass the protocol class to override methods in a particular way (making their code more reusable), and puts the complexity of matching up logical groupings of responses into a single place rather than forcing it to be replicated in each application.
     4
     5Several APIs which `IRCClient` provides which would benefit greatly from this treatment are `IRCClient.whois`, `IRCClient.names`, and `IRCClient.setNick`.
     6
     7Changing `IRCClient` itself to provide such APIs may be infeasible, as the obvious approaches would break many or most existing users.
     8
     9It's also important to remember, however, that many IRC messages which may be responses to requests may also be sent by the server unsolicited.  It does not make sense to associate this data with any particular Deferred, and so applications interested in such data will still likely need to override some callback method to get it.
     10
     11There is some prior art in this area in [browser:/sandbox/exarkun/irc2.py my sandbox].  There are other examples out there as well, though I don't have links handy.