Scala Clarification A Future That Never Ends and Its Impact on Other Callbacks

While rereading the scala.lan.org Future page here , I came across the following sentence:

If some of the callbacks never complete (for example, the callback contains an infinite loop), other callbacks may not be performed at all. In these cases, a potentially blocking callback should use a blocking construct (see below).

Why can't other callbacks be done at all? I can set some callbacks for this Future. A thread that completes the future may or may not make callbacks. But since one callback doesn’t keep up, the rest should not be punished, I think.

One of the possibilities that I can think of is a way to configure ExecutionContext. If it is configured with a single thread, this can happen, but this is a specific behavior and usually not expected behavior.

Did I miss something obvious here?

+3
source share
1 answer

Callbacks are called internally ExecutionContext, which has a limited number of threads, if not for a specific implementation of the context, and then for the underlying operating system and / or device.

, - OS_LIMIT . OS_LIMIT + 1. OS_LIMIT - .

, 1 - ?

, , Scala, : , , .

( Scala), , , , , . .

, - "" / / , , - ( ).

+5

All Articles