Skip to content

Give sentinel objects (or at least NEED_DATA and PAUSED) unique types #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
njsmith opened this issue Jul 2, 2016 · 1 comment
Closed

Comments

@njsmith
Copy link
Member

njsmith commented Jul 2, 2016

@dabeaz has requested this, to make it easier to take the thing that comes out of next_event() and dispatch it using functools.singledispatch or something like:

 class Handler(object):
     def handle_events(self):
            while True:
                   evt = conn.next_event()
                   name = 'handle_' + type(evt).__name__
                   getattr(self, name)(evt)

     def handle_Data(self, evt):
           ...

     def handle_EndOfMessage(self, evt):
          ...

     def handle_Response(self, evt):
          ...

     def handle_NEED_DATA(self, evt):
          ...

Seems reasonable enough to me.

RazerM added a commit to RazerM/h11 that referenced this issue Aug 6, 2016
RazerM added a commit to RazerM/h11 that referenced this issue Aug 6, 2016
@njsmith
Copy link
Member Author

njsmith commented Nov 7, 2016

Fixed by #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant