ContextImplementation

s2a.leucine.actors.ContextImplementation
abstract class ContextImplementation extends PlatformContext

Context implementation for the Native Platform

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def active: Boolean

True as long as there has been no Shutdown request.

True as long as there has been no Shutdown request.

Attributes

def await[M](digestable: Digestable[M], attempt: => Option[M]): Cancellable

Place a task on the Execution Context which is executed after some event arrives. When it arrives it may produce an result of some type. This result is subsequently passed to the digestable process. As longs as there is no result yet, the attempt should produce None

Place a task on the Execution Context which is executed after some event arrives. When it arrives it may produce an result of some type. This result is subsequently passed to the digestable process. As longs as there is no result yet, the attempt should produce None

Attributes

def execute(runnable: Runnable): Unit

Execute a new task on the current Execution Context directly

Execute a new task on the current Execution Context directly

Attributes

Returns the platform that is currentluy running, here Native.

Returns the platform that is currentluy running, here Native.

Attributes

def schedule(callable: Callable[Unit], delay: FiniteDuration): Cancellable

Plan a new task on the current Execution Context, which is run after some delay.

Plan a new task on the current Execution Context, which is run after some delay.

Attributes

def shutdown(force: Boolean): Unit

Perform a shutdown request. With force=false, the shutdown will be effective if all threads have completed there current thasks. With force=true the current execution is interrupted. In any case, no new tasks will be accepted. Once you have called shutdown, it is no longer possible to restart the mainloop.

Perform a shutdown request. With force=false, the shutdown will be effective if all threads have completed there current thasks. With force=true the current execution is interrupted. In any case, no new tasks will be accepted. Once you have called shutdown, it is no longer possible to restart the mainloop.

Attributes

def terminated: Boolean

True if all treads have completed, for the current Native this is never the case since the main has stopped if you could get true, but you can only read this from main tread.

True if all treads have completed, for the current Native this is never the case since the main has stopped if you could get true, but you can only read this from main tread.

Attributes

def waitForExit(force: Boolean, time: FiniteDuration)(shutdownRequest: => Boolean, complete: () => Unit): Unit

This method enters an endless loop until the application finishes. Every timeout, it will probe a shutdownrequest. There may be other reasons for shutdown as well. After all threads have completed (by force or not) the method calls complete() and returns. Call in the main thread as last action there. In Native it this also starts the mainloop. Normally you only call this once, but in certain situations (tests) it may be needed to call it multible times. In that case, make sure shutdownRequest is always false.

This method enters an endless loop until the application finishes. Every timeout, it will probe a shutdownrequest. There may be other reasons for shutdown as well. After all threads have completed (by force or not) the method calls complete() and returns. Call in the main thread as last action there. In Native it this also starts the mainloop. Normally you only call this once, but in certain situations (tests) it may be needed to call it multible times. In that case, make sure shutdownRequest is always false.

Attributes

Inherited methods

def idleThreadPause: FiniteDuration

The natural pause time for this context. Its meaning and use is platform dependant.

The natural pause time for this context. Its meaning and use is platform dependant.

Attributes

Inherited from:
PlatformContext
def load: Int

The average thread load per core. Override to change. This is only used on multithreaded platforms.

The average thread load per core. Override to change. This is only used on multithreaded platforms.

Attributes

Inherited from:
PlatformContext