Channels have two functions that allow us to send events into it. 
Send and offer.
I would like to understand better the difference between both.
I have some statements I wanna check are true.
- Sendis a suspend function. What will make my code(not the thread) wait for it to finish. So it keep running after the event inside- sendwas complete/cancelled. OR it will be suspend only until I can queue the event/receive it?
- This means that, if I use sendfrom one channel to another, the first channel will be block until the second can receive/queue?
- If I have a Rendezvous Channel and it is already running something (on suspend for example, waiting API) and I offera new even. This will makeofferthrows exception? Cause the channel is not receiving?
If you know any other main difference I would be glad to know.
Thanks in advance
 
                        
sendsuspends the coroutine it is invoked from while the channel being sent to is full.senddoes not send from one channel to another one. When you invokesendyou are sending an element to the channel. The channel then expects another block of code to invokereceivefrom a different coroutine.In a
RendezvousChannelthe capacity is0. This means thatsendalways suspends waiting for areceiveinvocation from another coroutine. If you have invokedsendon aRendezvousChanneland then useoffer,offerwill not throw an exception (it only does if the channel is closed), but rather it will returnfalseif no balancingreceivehas been invoked on theRendezvousChannelafter your initialsend. This is becauseoffertries to immediately add the element to the channel if it doesn't violate its capacity restrictions.