async Task IPostNotificationAsyncFilter.OnPostNotificationAsync(PostNotificationFilterContext context) { LogBoard <string> .Add(context.Actor, $"{_actorType.Name} Async.OnPostNotificationAsync"); await Task.Yield(); LogBoard <string> .Add(context.Actor, $"{_actorType.Name} Async.OnPostNotificationAsync Done"); }
protected override async Task OnGracefulStop() { _log.Add("OnGracefulStop"); await Task.Delay(10); _log.Add("OnGracefulStop done"); }
private void Handle(string message) { var type = message[0]; var value = message.Length >= 2 ? message.Substring(2) : ""; switch (type) { case 'S': RunTask(() => { _log.Add(message); }); break; case 'A': RunTask(async() => { _log.Add(message); await Task.Delay(10); _log.Add(message + " done"); }); break; case 'R': RunTask(async() => { _log.Add(message); await Task.Delay(10); _log.Add(message + " done"); }, isReentrant: true); break; case 'X': Self.Tell(InterfacedPoisonPill.Instance); break; } }
async Task IWorker.Atomic(int id) { _log.Add(Tuple.Create(id, 1)); await Task.Delay(10); _log.Add(Tuple.Create(id, 2)); await Task.Delay(10); _log.Add(Tuple.Create(id, 3)); }
async Task IWorker.Atomic(int id) { _log.Add(Tuple.Create(id, CurrentContext)); await Task.Delay(10); _log.Add(Tuple.Create(id, CurrentContext)); await Task.Delay(10); _log.Add(Tuple.Create(id, CurrentContext)); }
private async Task Handle(int id) { _log.Add($"Handle({id})"); if (_delay == 0) { await Task.Yield(); } else { await Task.Delay(_delay, CancellationToken); } _log.Add($"Handle({id}) Done"); }
void ISubjectObserver.Event(string eventName) { _log.Add($"Event({eventName})"); }
void IPostNotificationFilter.OnPostNotification(PostNotificationFilterContext context) { LogBoard <string> .Add(context.Actor, $"{_name}.OnPostNotification"); }
private void Event(string eventName) { var c = ObserverContext != null ? ObserverContext + ":" : ""; _log.Add(c + eventName); }
void ISubjectObserver.Event(string eventName) { var c = ObserverContext != null ? ObserverContext + ":" : ""; _log.Add(c + eventName); }
object IDummySync.Call(object param) { _log.Add($"Call({param})"); return(param); }
void IPostRequestFilter.OnPostRequest(PostRequestFilterContext context) { LogBoard <string> .Add(context.Actor, $"{_name}.OnPostRequest"); }
Task <int> IOverloaded.Min(int a, int b) { _log.Add($"Min({a}, {b})"); return(Task.FromResult(Math.Min(a, b))); }
private void OnMessage(Messages.Message m) { _log.Add("OnMessage:" + m.Value); }
void IPostMessageFilter.OnPostMessage(PostMessageFilterContext context) { LogBoard <string> .Add(context.Actor, $"{_name}.OnPostMessage"); }
private void Call() { _log.Add($"Call()"); }
private void Atomic(int id) { _log.Add($"Atomic {id}"); }
private int Min(int a, int b) { _log.Add($"Min({a}, {b})"); return(Math.Min(a, b)); }
int IOverloadedSync.Min(int a, int b) { _log.Add($"Min({a}, {b})"); return(Math.Min(a, b)); }
Task IBasic.Call() { _log.Add($"Call()"); return(Task.FromResult(0)); }
private void Event(string eventName) { _log.Add($"Event({eventName})"); }
private void Handle(string message) { _log.Add($"Handle({message})"); }
void IBasicSync.Call() { _log.Add($"Call()"); }
protected T HandleCall <T>(T param) { _log.Add($"Call({param})"); return(param); }
private void OnMessage(PlainMessages.Func message) { _log.Add(message.Value + "_1"); }