No but you can for example have a second channel from the pusher to the
observer that signals (in case it cannot push anymore) the latter that the
channel to which it tries to push to is full.
The opposite is true from the consumer, that could signal via a second
channel, when it cannot pull from a channel anymore, that it is empty?

Le jeu. 21 févr. 2019 à 14:51, Serhat Sevki Dincer <jfcga...@gmail.com> a
écrit :

> But observer goroutines are not supposed to push to or pull from the
> channel.
>
> 21 Şub 2019 Per 16:46 tarihinde Jan Mercl <0xj...@gmail.com> şunu yazdı:
>
>> On Thu, Feb 21, 2019 at 2:38 PM Serhat Şevki Dinçer <jfcga...@gmail.com>
>> wrote:
>>
>> > waitempty(ch)
>> > blocks caller until ch buffer is empty
>>
>> Not exactly the same, but a similar mechanism exists:
>>
>>         select {
>>         case x := <-ch:
>>                 ...
>>         default:
>>                 ... ch is empty
>>         }
>>
>> > waitfull(ch)
>> > blocks caller until ch buffer is full
>>
>> Dtto
>>
>>         select {
>>         case ch <- x:
>>                 ...
>>         default:
>>                 ... ch is full
>>         }
>>
>>
>> > What do you think?
>>
>> That the above is enough of gears to implement what you're after.
>>
>> --
>>
>> -j
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to