Wip sip23 √

@mariusaeriksen Sorry for the delayed response. I didn't until late, realize that you were agreeing with me that prepare() is bad.

The Capturing/Captured approach works, because it is not vulnerable to:

    package object myproject {
      implicit val ec: ExecutionContext = System.getProperty("ec") match {
        case "twitter" => TwitterEC
        case _ => DefaultEC
      }
    }

Because at all points in your (library) code you can parry for it:

    def someMethodInATwitterLibraryUsingLocals(f: () => Unit)(implicit ec: ExecutionContext): Unit = {
      def alwaysCaptureTwitterUtilLocal = ec match {
         case tec: TwitterLocalCapturingEC => tec
         case other => new TwitterLocalCapturingEC(delegateTo = other)
      }
    
      alwaysCaptureTwitterUtilLocal.execute(new FunctionRunnable(f))
    }


How prepare() works, can capture things that the provided EC does not capture in prepare().
The Capturing/Captured solution puts the power back to the library developer rather than the guy implementing potentially general purpose ExecutionContexts.

Do we agree?