try_send


Description:

public abstract Result<void*> try_send (owned G data)

Attempts to send a value into the channel. This method doesn't block the thread and returns immediately, regardless of success.

Errors:

  • ChannelError.CLOSED

If the channel has been closed.

  • ChannelError.TRY_FAILED

If the channel is full (bufferd channel), or there are no receive operations waiting for send operations (unbuffered channel).

Parameters:

data

a value

Returns:

the result which holds null if succeeded, or an error if failed.