Skip to content

Channels ‐ About

Devrath edited this page Dec 23, 2023 · 8 revisions

What are kotlin channels

  • Channels are used for asynchronous communication between the coroutines.
  • Channel can be imagined as a pipe where you can add the data from one end and get the data from another end.

How data are sent and received

  • Elements in the channel are processed in the same order as they arrive in.
  • There can be multiple producers that send the data to the channel and there can be multiple consumers that receive the data from the channel but on the receiving side among all the data received one of the consumers will receive it meaning the messages sent in channels are handled only once on the receiving side.

Clone this wiki locally