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

Timeout Semantics #50

Open
dario-loi opened this issue Jan 8, 2025 · 1 comment
Open

Timeout Semantics #50

dario-loi opened this issue Jan 8, 2025 · 1 comment

Comments

@dario-loi
Copy link

What is the preferred semantic to allow a given thread to timeout while waiting on a channel?

For example, assume that I have a producer that is going to input a certain amount of objects in a channel that is not known a priori, how can I write a consumer that is not going to deadlock as soon as the producer is finished?

Is there any such facility in the library or do I have to wrap the channel in user code? (is it even possible?).

@andreiavrammsd
Copy link
Owner

There is no timeout feature. You can try closing the channel, but the closable feature is known to not be stable in all cases.

The initial purpose of this channel was to live forever once started and only later I added the closable feature, which I did not test properly.

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

2 participants