twitter util の Local

1
ロービ @robey

doh! scala forgot to copy over “Local” from the twitter futures library. is there an equivalent, or am i heading to the workshop now? :)

2014-01-16 11:02:06
Evan Meagher @evanm

@jsuereth @robey https://t.co/MSlYaTkAWM They're used to capture local context when composing Futures and Promises.

2014-01-16 11:14:06
ロービ @robey

@evanm @jsuereth yeah, basically thread-local for futures.

2014-01-16 11:17:36
Josh Suereth @jsuereth

@robey @evanm Ah, gotcha. What we use implicits or closures for...

2014-01-16 11:23:46
ロービ @robey

@jsuereth @evanm in a service, it can be a useful way to bundle up session info for logging at deep levels without adding params everywhere

2014-01-16 11:27:06
Josh Suereth @jsuereth

@robey @evanm Totally understand. That was one thing thread-local was used for that implicits *can* replace.

2014-01-16 11:31:27
Josh Suereth @jsuereth

@robey @evanm Were Local's tied to the ExecutionContext you passed to futures?

2014-01-16 11:31:43
Evan Meagher @evanm

@jsuereth @robey Yes. They're saved/restored on entering/leaving a future composition or monitor.

2014-01-16 11:36:45
marius eriksen @marius

@evanm @jsuereth @robey this is why we put in ExecutionContext.prepare.

2014-01-16 12:53:11
Josh Suereth @jsuereth

@marius @evanm @robey Ah, so there's the posibility it can be added...

2014-01-16 12:57:40
marius eriksen @marius

@evanm @jsuereth @robey (which, @robey, gives you a hint about how you’d implement it.)

2014-01-16 12:57:54
Scott Clasen @scottclasen

@jsuereth @marius @evanm @robey adding local/monitor was discussed a while back on the scala-sips group https://t.co/49HCJAv5rS

2014-01-16 13:26:46
ロービ @robey

@marius @evanm @jsuereth is there a trap for those who would put it inside execute()?

2014-01-16 13:51:22