to ( value channel -- )
Channels
Prev:<channel> ( -- channel )
Next:from ( channel -- value )


Vocabulary
channels

Inputs and outputs
valuean object
channela channel object


Word description
Sends an object to a channel. The send operation is synchronous. It will block the calling thread until there is a receiver waiting for data on the channel. It will return when the receiver has received the data successfully.

See also
<channel>, from

Definition
IN: channels

GENERIC: to ( value channel -- )


Methods
USING: accessors channels channels.private kernel sequences ;

M: channel to
dup receivers>> [ dup wait to ] [ nip (to) ] if-empty ;


USING: accessors channels channels.remote
channels.remote.private kernel ;

M: remote-channel to
[ id>> swap to-message boa ] keep send-message drop ;