@Local public void init() { tables = new HashMap(); stateListeners = new ArrayList(); tableDesc = new HashMap(); }
/** * cb is invoked once the server sends back messages to a client, * the client does not necessary have an actor running but might simply connect * using ordinary mt code * @param cb */ @Local @CallerSideMethod public void setServerMsgCallback(Callback<RemoteCallEntry> cb) { zzServerMsgCallback = cb; } /**
/** * cb is invoked once the server sends back messages to a client, * the client does not necessary have an actor running but might simply connect * using ordinary mt code * @param cb */ @Local @CallerSideMethod public void setServerMsgCallback(Callback<RemoteCallEntry> cb) { zzServerMsgCallback = cb; } /**
@CallerSideMethod @Local public DispatcherThread getCurrentDispatcher() { return (DispatcherThread) __currentDispatcher; }
@Local public void debounce(long timeout, String tag, Runnable toRun ) { if ( _debounceMap == null ) _debounceMap = new HashMap<>(7); _debounceMap.put(tag,toRun); delayed(timeout, () -> { if ( _debounceMap.get(tag) == toRun ) { _debounceMap.remove(tag); toRun.run(); } }); }
@Local public void debounce(long timeout, String tag, Runnable toRun ) { if ( _debounceMap == null ) _debounceMap = new HashMap<>(7); _debounceMap.put(tag,toRun); delayed(timeout, () -> { if ( _debounceMap.get(tag) == toRun ) { _debounceMap.remove(tag); toRun.run(); } }); }
@Local public void unpublish() { if ( __connections != null ) __connections.forEach( conreg -> conreg.unpublishActor(this)); }
@Local public void router$handleServiceDisconnect(Actor x) { //FIXME: reply pending callbacks / promises with error boolean remove = remoteServices.remove(x.getActor()); if ( ! remove ) remove = remoteServices.remove(x.getActorRef()); if ( ! remove ) { // can happen multiple times } else { Log.Info(this, "removed service "+x); } }
@Local public void unpublish() { if ( __connections != null ) __connections.forEach( conreg -> conreg.unpublishActor(this)); }
@Local public void router$handleServiceDisconnect(Actor x) { //FIXME: reply pending callbacks / promises with error boolean remove = remoteServices.remove(x.getActor()); if ( ! remove ) remove = remoteServices.remove(x.getActorRef()); if ( ! remove ) { // can happen multiple times } else { Log.Info(this, "removed service "+x); } }
@Local public void asyncstop() { hasStopped(); __stop(); }
@Local public void asyncstop() { hasStopped(); __stop(); }
@Local public IPromise init(Supplier<RecordStorage> storeFactory, TableDescription desc) { this.description = desc; Thread.currentThread().setName("Table "+(desc==null?"NULL":desc.getName())+" main"); RecordStorage store = storeFactory.get(); storageDriver = new StorageDriver(store); filterProcessor = new FilterProcessor(this); storageDriver.setListener( filterProcessor ); return resolve(); }
/** * just enqueue given runable to this actors mailbox and execute on the actor's thread * WARNING: the similar named method execInThreadPool() works different (bad naming) * @param command */ @CallerSideMethod @Local @Override public void execute(Runnable command) { self().__submit(command); }
/** * just enqueue given runable to this actors mailbox and execute on the actor's thread * WARNING: the similar named method execInThreadPool() works different (bad naming) * @param command */ @CallerSideMethod @Local @Override public void execute(Runnable command) { self().__submit(command); }
/** * schedule an action or call delayed. * typical use case: * delayed( 100, () -> { self().doAction( x, y, ); } ); * */ @CallerSideMethod @Local public void delayed( long millis, final Runnable toRun ) { __scheduler.delayedCall(millis, inThread(self(), toRun)); }
@Local public void init() { timeoutMap = new HashMap<>(); clients = new HashMap<>(); nextAliveRemoteActors = new HashSet<>(); delayed(getServicePingTimeout(), () -> cyclic( getServicePingTimeout(), () -> {pingServices(); return true;} ) ); delayed(getClientPingTimeout(), () -> cyclic( getClientPingTimeout(), () -> {checkPingOnClients(); return true;} ) ); delayed(CLIENT_PING_INTERVAL_MS*2, () -> cyclic( CLIENT_PING_INTERVAL_MS*2, () -> { timeoutMap.clear(); return true; } ) ); }
@Local public void router$handleServiceDisconnect(Actor x) { if ( x.getActor() == getRemoteRef() || x.getActorRef() == getRemoteRef() ) setRemoteRef(null); }
@Local public void init() { timeoutMap = new HashMap<>(); clients = new HashMap<>(); nextAliveRemoteActors = new HashSet<>(); delayed(getServicePingTimeout(), () -> cyclic( getServicePingTimeout(), () -> {pingServices(); return true;} ) ); delayed(getClientPingTimeout(), () -> cyclic( getClientPingTimeout(), () -> {checkPingOnClients(); return true;} ) ); delayed(CLIENT_PING_INTERVAL_MS*2, () -> cyclic( CLIENT_PING_INTERVAL_MS*2, () -> { timeoutMap.clear(); return true; } ) ); }
@Local public void router$handleServiceDisconnect(Actor x) { if ( x.getActor() == getRemoteRef() || x.getActorRef() == getRemoteRef() ) setRemoteRef(null); }