Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose Stream.die via Stream.GetDieCh for canceling running golang RPC func #40

Merged
merged 3 commits into from
Dec 5, 2018

Conversation

auxten
Copy link
Contributor

@auxten auxten commented Dec 4, 2018

We are working on a Blockchain featured SQL database: CovenantSQL
Because golang net/rpc did not provide a context. We have no way to get notified when something happened to the underlying TCP connection to cancel a running RPC.
Thanks to xtaci/smux, it is possible with Stream.die exposed.

@codecov-io
Copy link

codecov-io commented Dec 4, 2018

Codecov Report

Merging #40 into master will increase coverage by 0.85%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #40      +/-   ##
==========================================
+ Coverage   85.56%   86.42%   +0.85%     
==========================================
  Files           4        4              
  Lines         381      383       +2     
==========================================
+ Hits          326      331       +5     
+ Misses         49       47       -2     
+ Partials        6        5       -1
Impacted Files Coverage Δ
stream.go 82.87% <100%> (+0.23%) ⬆️
session.go 87.62% <0%> (+1.54%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f19baee...9a59621. Read the comment docs.

@xtaci
Copy link
Owner

xtaci commented Dec 4, 2018

I recommend to add a function to return s.die instead of exposing the variable directly

@xtaci
Copy link
Owner

xtaci commented Dec 4, 2018

and also make it return a recv only chan

@auxten
Copy link
Contributor Author

auxten commented Dec 5, 2018

I recommend to add a function to return s.die instead of exposing the variable directly and also make it return a recv only chan

Good advise, done.

@auxten auxten changed the title Expose Stream.die to Stream.Die for canceling running golang RPC func Expose Stream.die via Stream.GetDieCh for canceling running golang RPC func Dec 5, 2018
@xtaci xtaci merged commit 6cf098d into xtaci:master Dec 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants