Class GameThreadRouting
java.lang.Object
privbot.context.GameThreadRouting
The decisions
GameThread makes, as pure functions of what a copy knows and where it is
called from. No threads, no client: GameThread gathers the GameThreadRouting.Facts and acts on the
GameThreadRouting.Route, and the table is tested on its own.
Facts are read lazily and in the order the original code read them, so a route that used to return before asking "which server is this" still does.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceWhat oneGameThreadcopy knows at the moment of a call.static enumWhere a call runs. -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringdescribe(GameThreadPolicy policy, boolean hasGameThread, boolean hasClientThread, boolean edtMarshalServer) A short name for whatpolicyamounts to for a copy in this state; for the log.static GameThreadRouting.Routeensure(GameThreadPolicy policy, GameThreadRouting.Facts f) static GameThreadRouting.RouteinvokeLater(GameThreadPolicy policy, GameThreadRouting.Facts f) Route forGameThread.invokeLater(java.lang.Runnable).static booleanAnswer forGameThread.isClientThread().
-
Method Details
-
ensure
-
invokeLater
public static GameThreadRouting.Route invokeLater(GameThreadPolicy policy, GameThreadRouting.Facts f) Route forGameThread.invokeLater(java.lang.Runnable). The policy does not alter it: it never waits. -
isClientThread
Answer forGameThread.isClientThread(). -
describe
public static String describe(GameThreadPolicy policy, boolean hasGameThread, boolean hasClientThread, boolean edtMarshalServer) A short name for whatpolicyamounts to for a copy in this state; for the log.
-