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

Add a context to cmds.Request #505

Closed
whyrusleeping opened this issue Jan 7, 2015 · 7 comments
Closed

Add a context to cmds.Request #505

whyrusleeping opened this issue Jan 7, 2015 · 7 comments
Assignees
Milestone

Comments

@whyrusleeping
Copy link
Member

Currently (unless I'm missing something) we have no way of allowing the user to cancel a command. If we add in a context to the request handler it will allow us to have a mechanism to cancel commands with.

@jbenet
Copy link
Member

jbenet commented Jan 7, 2015

@whyrusleeping yep, the context should be cancelled if/when the request's connection terminates.

@jbenet
Copy link
Member

jbenet commented Jan 7, 2015

it's gonna get confusing cause the request already has a context (it's something else atm).

@jbenet
Copy link
Member

jbenet commented Jan 8, 2015

related: #242

@jbenet
Copy link
Member

jbenet commented Jan 15, 2015

this is done. just needs to be wired to more commands (ipfs refs does it, albeit in avery ugly way (see that writer trick)

@jbenet jbenet modified the milestone: Daemon Apr 1, 2015
@rht
Copy link
Contributor

rht commented Aug 13, 2015

(ipfs refs does it, albeit in avery ugly way (see that writer trick)

Does this refer to https://github.com/ipfs/go-ipfs/blob/master/core/commands/refs.go#L105?
Which commands don't have request context?

@jbenet
Copy link
Member

jbenet commented Aug 15, 2015

@rht not sure, we should go through all of them and make sure all the ctx related thing derive from req.Context()

@whyrusleeping
Copy link
Member Author

yeah, i recently refactored and made the req.Context() more reliable, and also made it respect the global timeout flag. We should go through and make sure that it is used correctly all over the codebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants