示例#1
0
            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");
            }
示例#2
0
            protected override async Task OnGracefulStop()
            {
                _log.Add("OnGracefulStop");
                await Task.Delay(10);

                _log.Add("OnGracefulStop done");
            }
示例#3
0
            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));
            }
示例#6
0
            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");
            }
示例#7
0
 void ISubjectObserver.Event(string eventName)
 {
     _log.Add($"Event({eventName})");
 }
示例#8
0
 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)));
 }
示例#14
0
 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));
 }
示例#21
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()");
 }
示例#24
0
 protected T HandleCall <T>(T param)
 {
     _log.Add($"Call({param})");
     return(param);
 }
示例#25
0
 private void OnMessage(PlainMessages.Func message)
 {
     _log.Add(message.Value + "_1");
 }