Skip to content

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

Open

Description

@njsmith

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.

Activity

  1. 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)[/+] on Mar 12, 2019
  2. oremanj commented on Mar 12, 2019

    @oremanj
    Member

    We also need a replacement for the deprecated UnboundedQueue.

  3. richardsheridan commented on Nov 20, 2023

    @richardsheridan
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions