开发者

Concepts: Channel vs. Stream

开发者 https://www.devze.com 2022-12-30 02:04 出处:网络
is there a conceptual difference between the terms \"Channel\" and \"Stream\"? Do the terms require/determine, for example, the allowed number of concurrent Consumers or Producers?

is there a conceptual difference between the terms "Channel" and "Stream"? Do the terms require/determine, for example, the allowed number of concurrent Consumers or Producers?

I'm cur开发者_Go百科rently developing a Channel/Stream of DataFlowVariables, which may be written by one producer and read by one consumer as the implementation is destructive/mutable. Would this be a Channel or Stream, is there any difference at all?

Thanks


These terms are widely used for many and varied concepts. They are roughly synonymous and often used interchangeably.

In some contexts, a channel refers to a subdivision of a large communication medium. For instance, radio and TV stations use "channels" to describe the frequency-division multiplexing approach to separating signals. The AMQP message-bus protocol uses channels to multiplex traffic over a TCP session.

In computer science, the term channel sometimes refers to a message-oriented pipe between communicating end-points. Tony Hoare's CSP (from which Occam, Limbo, and Google's Go are derived) use channels as the fundamental unit of communication and synchronisation.

The term stream, OTOH, tends to refer more to a byte-oriented communication pipe, such as a TCP socket, which delivers a continuous stream of bytes or characters, without a clear subdivision that separates one message from another.


I'm not quite sure what you are talking about but...

A channel usually refers to some physical construction or virtual pathway to stream something through.

A stream is actually that something that is being streamed through a channel.

Does this make any sense?


The "Channel" determines HOW you transmitit data. The "stream" is the concrete data transmited through one channel.

0

精彩评论

暂无评论...
验证码 换一张
取 消