public SkynetActor(IActor parent, long number, long size, long dv, IFuture <long> future) { _number = number; _parent = parent; _future = future; _actorQtt = dv; Become( new Behavior <long>((i) => { _accumulator += i; _actorQtt--; if (_parent != null) { if (_actorQtt == 0) { _parent.SendMessage(_accumulator); } } else { if ((future != null) && (_actorQtt == 0)) { future.SendMessage(_accumulator); } } }), new Behavior <string>((s) => { if (size != 1) { for (int i = 0; i < dv; i++) { var sub_num = _number + (i * (size / dv)); new SkynetActor(this, sub_num, size / dv, dv, null); } } else { _parent.SendMessage(_number); } })); SendMessage("start"); }
public void AskData(IFuture <string> future) { CheckArg.Future(future); future.SendMessage(fData); }
private void GetCurrentState(IFuture <TState> future) => future.SendMessage(Current);
private void DoFlush(TextWriterActor actor, IFuture <bool> future) { fStream.Flush(); future.SendMessage(true); }
public void DecoratedMessage(string s) { fAnswer = s; future.SendMessage(s); }
private void GetValue(IFuture <T> future) => future.SendMessage(((StateBehaviors <T>)LinkedTo).Value);
private void DoGetAll(IFuture future) { IEnumerable <string> list = fShardList.ToList().AsEnumerable(); future.SendMessage(list); }
internal void DecoratedMessage(string s) { future.SendMessage(s); }