docker / libchan

Like Go channels over the network
Apache License 2.0
2.47k stars 142 forks source link

Proposal: Use context throughout libchan #52

Open pnasrat opened 9 years ago

pnasrat commented 9 years ago

In libchan we need a way to seamlessly carry trace, debugging, cancellation and other data across boundaries - whether that be process, goroutine or RPC.

The code.google.com/p/go.net/context package provides wiring to do this. References http://blog.golang.org/context

If libchan can be seamlessly used over unix socket, go channels, etc a standardized mechanism for propagating scoped values, cancelation signals, and deadlines, etc across the boundaries would be awesome.

I'm happy to do the work but not sure if this is something people feel a need for at the moment

@shykes @dmcgowan ?

dmcgowan commented 9 years ago

There might be some overlap here with the proposal for logging and debugging but worth keeping separate. I think as we get closer to moving libchan into other projects this will be an important part of debugging. I think first off we need to figure out if these contexts are something that just need to be added as objects which are passed along as any other object or whether contexts should be transient and either we find a way to attach them to channel identifiers or make a protocol update.