It looks like the channel is available directly on the Request
. Consider Request.__init__
:
def __init__(self, channel, queued):
"""
@param channel: the channel we're connected to.
@param queued: are we in the request queue, or can we start writing to
the transport?
"""
self.notifications = []
self.channel = channel
self.queued = queued
...
self.channel = channel
seems to be just what you're looking for.