cs01 / cs01/pygdbmi

IoManager implementation

Open
#109 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
260
Forks
53
PR merge metrics
No merged PRs in 30d

Description

I have a quick question. In the [IoManager](https://github.com/cs01/pygdbmi/blob/d570d7157f6fa081208bc82269a8efff87505708/pygdbmi/IoManager.py#L145) 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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.