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.blocking
when 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 ofBlockContext
by first looking for one provided throughBlockContext.withBlockContext()
and failing that, checking whetherThread.currentThread
is an instance ofBlockContext
. So a thread pool can have itsjava.lang.Thread
instances implementBlockContext
. There's a defaultBlockContext
used if the thread doesn't implementBlockContext
.Typically, you'll want to chain to the previous
BlockContext
, like this: