Пример #1
0
        public static void AddTimerRoute(this IRouteBuilder routeBuilder)
        {
            routeBuilder.MapPut("actors/{actorTypeName}/{actorId}/method/timer/{timerName}", async context =>
            {
                var routeValues   = context.Request.RouteValues;
                var actorTypeName = (string)routeValues["actorTypeName"];
                var actorId       = (string)routeValues["actorId"];
                var timerName     = (string)routeValues["timerName"];

                // read dueTime, period and data from Request Body.
                await ActorRuntime.FireTimerAsync(actorTypeName, actorId, timerName);
            });
        }
Пример #2
0
        public static IEndpointConventionBuilder AddTimerRoute(this IEndpointRouteBuilder endpoints)
        {
            return(endpoints.MapPut("actors/{actorTypeName}/{actorId}/method/timer/{timerName}", async context =>
            {
                var routeValues = context.Request.RouteValues;
                var actorTypeName = (string)routeValues["actorTypeName"];
                var actorId = (string)routeValues["actorId"];
                var timerName = (string)routeValues["timerName"];

                // read dueTime, period and data from Request Body.
                await ActorRuntime.FireTimerAsync(actorTypeName, actorId, timerName);
            }));
        }