Thanks to visit codestin.com
Credit goes to github.com

Skip to content

IoManager implementation #109

@kotborealis

Description

@kotborealis

I have a quick question. In the IoManager the function that retrieves a response uses timeouts in a non-intuitive way.

If I call it with a timeout of 10 seconds, it always blocks for the full 10 seconds, even if the response arrives immediately. This negatively affects performance, because each call takes the full timeout duration. I understand that I can set the timeout to 0 seconds, but then I have to implement throttling on the caller side to avoid spinning the CPU in a tight loop.

Would it be possible to introduce a flag that changes this behavior so that, if a timeout is specified, the function waits up to that duration for a response but returns as soon as a response is available?

If this sounds reasonable, I can prepare a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions