File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
docs/5. Advanced Techniques Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ Let's take a look at
72
72
As Cristian Prieto says, in this example, ` asyncio.Queue ` is our way to communicate between the producer of items
73
73
and its consumer, it will await until the queue has an item to give us.
74
74
75
+ ### Channels vs Queues
76
+ The term channel is used in languages like Golang and Kotlin. Channel is not exactly the same as queue.
77
+ In short, a queue is a storage mechanism, while a channel is a communication mechanism (which may internally use a queue).
78
+ Actually, a queue is a data structure that stores elements in a first-in, first-out (FIFO) order,
79
+ while a channel is a communication mechanism that allows asynchronous data transfer between different parts of a program.
80
+
75
81
## asyncio Future
76
82
[ Future objects are used to bridge low-level callback-based code with high-level async/await code.
77
83
] ( https://docs.python.org/3/library/asyncio-future.html )
You can’t perform that action at this time.
0 commit comments