This method allow us to use a channel as an async Iterable
This stack will contain all the messages sended by the channel's users This stack will contain all the 'resolve' functions of the putters. When a process put a value into the channel a Promise is returned. The 'resolve' function of that Promise ends here This stack will contain all the 'resolve' functions of the takers. When a process take a value from the channel a Promise is returned. The 'resolve' function of that Promise ends here This stack will contain all the 'resolve' functions of the racers. When a process execute Channel.alts or Channel.select a Promise is returned. The 'resolve' function of that Promise ends here
If there are no messages to be taken, the returned array will be empty
A promise that will be fulfilled with an array containing all the messages present into a channel
If there is already a taker or a racer waiting a message, the returned promise will be immediately resolved
If both a taker and a racer were waiting a message the priority is given to the taker that will retrieve the message
A value that will be forwarded into the channel
A promise that will be fulfilled when someone takes the msg from the channel
Transform a Channel into a Promise that wraps the channel itself. The promise will be fulfilled immediately if here is already a message ready to be taken. Otherwise the promise will be fulfilled with the channel when a process do a put operation, but only if there was no a waiting taker
A promise wrapping a Channel
If there is already a message ready to be taken, the returned promise will be immediately resolved and the message read
A promise that will be fulfilled when someone put a message into the channel
Generated using TypeDoc
This interface represent a channel. It has 4 FIFO stacks plus some methods to operate with those sstacks.