Skip to content

Know how many items are in stream #352

Answered by agronholm
johnflavin asked this question in Q&A
Discussion options

You must be logged in to vote

Wouldn’t I want tasks_waiting_receive to be nonzero if the stream is empty?

Doesn't the stream being "empty" mean that there are no items queued to be delivered? If so, then tasks_waiting_receive is a non-factor.

I don’t know about current_buffer_used though. What does that mean?

When you create a memory object stream, you define the maximum buffer size. If a task tries to send an object to the stream and there are no tasks waiting to receive, the object goes to the buffer if there are free slots in the stream. In such cases, the send() method returns immediately without blocking. The current_buffer_used statistics tells you how many items there are in the buffer waiting for tasks to …

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@johnflavin
Comment options

Comment options

You must be logged in to vote
3 replies
@agronholm
Comment options

@johnflavin
Comment options

@agronholm
Comment options

Answer selected by johnflavin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants