Closed wllenyj closed 2 years ago
@wllenyj Awesome! Thanks a ton for introducing this so important feature. @jodh-intel @mxpv @lifupan @liubin Please take a look at this.
@dmcgowan Any time to help with this? Thanks a lot.
@wllenyj thanks! I'll take a look
Merging #146 (98d128d) into master (8f2bd91) will increase coverage by
14.34%
. The diff coverage is37.58%
.
@@ Coverage Diff @@
## master #146 +/- ##
===========================================
+ Coverage 11.68% 26.02% +14.34%
===========================================
Files 13 16 +3
Lines 1549 2413 +864
===========================================
+ Hits 181 628 +447
- Misses 1368 1785 +417
Impacted Files | Coverage Δ | |
---|---|---|
src/asynchronous/client.rs | 0.00% <0.00%> (ø) |
|
src/asynchronous/connection.rs | 0.00% <0.00%> (ø) |
|
src/asynchronous/server.rs | 0.00% <0.00%> (ø) |
|
src/asynchronous/stream.rs | 0.00% <0.00%> (ø) |
|
src/asynchronous/utils.rs | 0.00% <ø> (ø) |
|
src/common.rs | 34.57% <ø> (-14.76%) |
:arrow_down: |
src/error.rs | 55.55% <ø> (+55.55%) |
:arrow_up: |
src/lib.rs | 100.00% <ø> (ø) |
|
src/sync/channel.rs | 0.00% <ø> (ø) |
|
src/sync/client.rs | 0.00% <0.00%> (ø) |
|
... and 8 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
Introduce support for streaming(https://github.com/containerd/ttrpc/blob/main/PROTOCOL.md#streaming). This is already supported by Golang's TTRPC in https://github.com/containerd/ttrpc/pull/107. But currently only async is implemented. Related issues #144.
This pull request changes include:
shutdown
module to handle graceful shutdown.Usually, streaming supports 3 types:
These 3 types are the same as GRPC, see https://grpc.io/docs/what-is-grpc/core-concepts/#server-streaming-rpc for details.
A general
Bidirectional streaming
process is as follows:The
Connection
is an abstraction of a connection. One connection is handled as oneWrite
async-task and oneRead
async-task.Write
task receives the message from the channel and writes it to the connection.Read
task receives the message from the connection and writes it to the channel.