public class Actors extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ActorProxyFactory |
factory |
static Actors |
instance |
| Modifier | Constructor and Description |
|---|---|
protected |
Actors() |
| Modifier and Type | Method and Description |
|---|---|
static void |
AddDeadLetter(String s) |
static <T extends Actor> |
AsActor(Class<? extends Actor> actorClazz)
create an new actor.
|
static <T extends Actor> |
AsActor(Class<? extends Actor> actorClazz,
int qSize)
create an new actor.
|
static <T extends Actor> |
AsActor(Class<? extends Actor> actorClazz,
Scheduler scheduler)
create an new actor dispatched in the given DispatcherThread
|
static <T extends Actor> |
AsActor(Class<? extends Actor> actorClazz,
Scheduler scheduler,
int qsize)
create an new actor dispatched in the given DispatcherThread
|
static Future<Future[]> |
async(Callable<Future>... toexec)
mimics scala's async macro. callables are executed in order. if a callable returns a promise,
execution of the next callable is deferred until the promise is fulfilled.
|
protected Queue |
createQueue(int qSize) |
static ConcurrentLinkedQueue<String> |
DeadLetters()
messages that have been dropped or have been sent to stopped actors
|
ActorProxyFactory |
getFactory() |
static <T> T |
InThread(T anInterface)
in case called from an actor, wraps the given interface instance into a proxy such that
a calls on the interface get schedulled on the actors thread (avoids accidental multithreading
when handing out callback/listener interfaces from an actor)
|
protected Actor |
makeProxy(Class<? extends Actor> clz,
DispatcherThread disp,
int qs) |
protected Actor |
newProxy(Class<? extends Actor> clz,
Scheduler sched,
int qsize) |
<T> T |
sync(Future<T> fut)
block until future returns.
|
static Object[] |
toResults(Future[] futs) |
static Future<Future[]> |
yield(Future... futures) |
static Future<List<Future>> |
yield(List<Future> futures) |
public static Actors instance
protected ActorProxyFactory factory
public static void AddDeadLetter(String s)
public static <T> T InThread(T anInterface)
T - anInterface - public static ConcurrentLinkedQueue<String> DeadLetters()
public static <T extends Actor> T AsActor(Class<? extends Actor> actorClazz)
T - actorClazz - public static <T extends Actor> T AsActor(Class<? extends Actor> actorClazz, int qSize)
T - actorClazz - public static <T extends Actor> T AsActor(Class<? extends Actor> actorClazz, Scheduler scheduler)
T - actorClazz - public static <T extends Actor> T AsActor(Class<? extends Actor> actorClazz, Scheduler scheduler, int qsize)
T - actorClazz - public static Future<Future[]> async(Callable<Future>... toexec)
toexec - public ActorProxyFactory getFactory()
public <T> T sync(Future<T> fut)
T - fut - protected Actor makeProxy(Class<? extends Actor> clz, DispatcherThread disp, int qs)
protected Queue createQueue(int qSize)
Copyright © 2015. All rights reserved.