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

Golang like Context #139

Open
corporatepiyush opened this issue Aug 6, 2017 · 4 comments
Open

Golang like Context #139

corporatepiyush opened this issue Aug 6, 2017 · 4 comments

Comments

@corporatepiyush
Copy link

Is there an equivalent to Golang's context ?

https://golang.org/pkg/context/

@corporatepiyush corporatepiyush changed the title Golang like Context for gorutines Golang like Context Aug 6, 2017
@gt3
Copy link

gt3 commented Aug 7, 2017

Correct me if I'm wrong but shouldn't Context be a package in itself that depends on channels (js-csp)? Also I feel that we're already biting off more than we can chew here.

I enjoyed reading the docs. Interesting concept...

@corporatepiyush Curious to know if you have a use case or you're just sharing?

@corporatepiyush
Copy link
Author

Its not a feature request, just a question since I didnt find any context based libs based on js-csp. I was wondering if I were to use this library (over Golang) for writing complex business logic
how would I cope with keeping context across many goroutines

As you would have realized from Context package doc link, its pretty much useful to maintain context across a given request flow consisting of goroutine execution in sequence or in parallel and take decision like exception handling, execution cancellation etc.

But more than anything I was more concerned about error handling and making use of Context like feature or some external lib (if exists one).

I am definitely not an expert on this one, but without Golang like Context it's pretty hard to achieve.
Dean Wampler has a nice presentation about this one.
https://www.slideshare.net/deanwampler/error-handling-in-reactive-systems

@gt3
Copy link

gt3 commented Aug 7, 2017

Really great content there.. especially comparison with the actor model. Thanks for sharing.

@frankandrobot
Copy link
Contributor

We use context in a go project and it's basically an immutable data structure that knows when it expires. I agree with @gt3 , it should be it's own package that uses channels.

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

No branches or pull requests

3 participants