Ejemplo n.º 1
0
        public Task <ActivityContext> ExecuteSingle(WorkflowActivity activity, ActivityContext context)
        {
            //TODO: consider different grain allocation strategy
            //perhaps it should be created from hashcode of activity implementation or something
            var worker = GrainFactory.GetGrain <IWorkerGrain>(Guid.NewGuid());

            try
            {
                return(worker.ExecuteAsync(activity, context));
            }
            catch (Exception e)
            {
                _logger.LogError(e, $"Unhandled exception thrown while running activity of type = {activity.GetType().FullName}");
            }

            return(Task.FromResult <ActivityContext>(null));
        }