Skip to main content

A queue is a higher level concept than a stream. The base elements of a queuequeue is a message/object, which is a coherent (usually typed) data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a streamstream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. 

A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent (usually typed) data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent (usually typed) data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. 

A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

added 16 characters in body
Source Link
Lie Ryan
  • 12.5k
  • 2
  • 33
  • 43

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent (usually typed) data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent (usually typed) data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.

Source Link
Lie Ryan
  • 12.5k
  • 2
  • 33
  • 43

A queue is a higher level concept than a stream. The base elements of a queue is a message/object, which is a coherent data structure that can be interpreted by the consumer on its own. On the other hand, at the base of a stream, there is (usually fixed-size) bits/bytes/characters, which, on its own, is usually meaningless to the application. A sequence of these characters may compose a "message", but a stream API leaves it to the application to split the sequence of characters into sensible chunks. A Stream API usually also allows partial reads and writes, if the stream buffers are full and the other side isn't reading/writing; applications that handles queues usually expects the queue to handle these internally.

A queue may be implemented on top of a stream, this is done by implementing message framing. For example, TCP provides a stream interface, HTTP is built on top of TCP, and adds message framing using Content-Length/chunked transfer encoding. Users of an HTTP Connection API are abstracted from dealing with splitting HTTP connection stream to HTTP requests.

On the other hand, usually, it makes less sense to implement a stream API on top of a queue, as the handling of message framing adds unnecessary overhead.