Used internally by the framework;
Designates (and eventually executes) a thunk which potentially blocks the calling Thread.
Used internally by the framework;
Designates (and eventually executes) a thunk which potentially blocks the calling Thread.
Clients must use scala.concurrent.blocking or scala.concurrent.Await instead.
Returns string formatted according to given format string.
Returns string formatted according to given format string.
Format strings are as for String.format
(@see java.lang.String.format).
A context to be notified by
scala.concurrent.blockingwhen a thread is about to block. In effect this trait provides the implementation forscala.concurrent.Await.scala.concurrent.Await.result()andscala.concurrent.Await.ready()locates an instance ofBlockContextby first looking for one provided throughBlockContext.withBlockContext()and failing that, checking whetherThread.currentThreadis an instance ofBlockContext. So a thread pool can have itsjava.lang.Threadinstances implementBlockContext. There's a defaultBlockContextused if the thread doesn't implementBlockContext.Typically, you'll want to chain to the previous
BlockContext, like this: