Wip sip23 √

Can you give a code example that wouldn't work with my proposal?
On Jun 30, 2014 7:28 PM, "marius a. eriksen" <notifications@github.com>
wrote:

> In src/library/scala/concurrent/ExecutionContext.scala:
>
> > +     *  execution context. The recommended implementation of
> > +     *  `prepare` is to return `this`.
> > +     *
> > +     *  This method should no longer be overridden or called. It was
> > +     *  originally expected that `prepare` would be called by
> > +     *  all libraries that consume ExecutionContexts, in order to
> > +     *  capture thread local context. However, this usage has proven
> > +     *  difficult to implement in practice and instead it is
> > +     *  now better to avoid using `prepare` entirely.
> > +     *
> > +     *  Instead, if an `ExecutionContext` needs to capture thread
> > +     *  local context, it should capture that context when it is
> > +     *  constructed, so that it doesn't need any additional
> > +     *  preparation later.
> > +     */
> > +  @deprecated("Preparation of ExecutionContexts will be removed.", "2.12")
>
> But those implementations don't do the right thing. We're not interested
> in capturing context at *execution* time, but rather at *suspension* time
> (e.g. consider implementing com.twitter.util.Local
> <https://github.com/twitter/util/blob/master/util-core/src/main/scala/com/twitter/util/Local.scala>
> )
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/viktorklang/scala/pull/6/files#r14362808>.
>