Skip to content
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

Improve low-level IO monitor functions (for IOCP and kqueue) #40

Open
njsmith opened this issue Feb 5, 2017 · 2 comments
Open

Improve low-level IO monitor functions (for IOCP and kqueue) #40

njsmith opened this issue Feb 5, 2017 · 2 comments

Comments

@njsmith
Copy link
Member

njsmith commented Feb 5, 2017

These should take a queue, rather than returning a queue, to support the case where you want to register multiple filters and multiplex them onto the same queue. (This is probably more important for kqueue than IOCP, b/c in IOCP you can take the completion key and use it for multiple registrations? but either way.)

CompletionKeyEventInfo should also carry the actual completion key, b/c it becomes ambiguous.

@oremanj oremanj changed the title The IO monitor functions (iocp completion key, kqueue filter) should take a queue, not return a queue Improve low-level IO monitor functions (for IOCP and kqueue) Mar 12, 2019
@oremanj
Copy link
Member

oremanj commented Mar 12, 2019

We also need a replacement for the deprecated UnboundedQueue.

@richardsheridan
Copy link
Contributor

Maybe I'm missing something, but haven't we been able to resolve this for some time? Currently the only internal usages of UnboundedQueue only need to meet the requirements of:

  • Have a put_nowait method
  • don't raise

Specifically:

queue.put_nowait(info)

and

receiver.put_nowait(event)

we could swap this for send_nowait and have the monitor functions accept a MemorySendChannel, although we'd be better off to protect the internal state of the IOManager with a try/except/warn?/pass in case the user forgets to make it unbounded.

We could also be even more flexible and have these methods just accept a callback. I know callbacks are "bad," but then we don't have to concern ourselves with how the user wants to handle things.

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

No branches or pull requests

3 participants