• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lucaslorentz / durabletask-extensions / 5835653629

pending completion
5835653629

push

github

lucaslorentz
Add ExtendedOrchestrationContext to simplify workers API

71 of 71 new or added lines in 5 files covered. (100.0%)

2303 of 2798 relevant lines covered (82.31%)

145.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/src/LLL.DurableTask.Worker/OrchestrationBase.cs
1
using System.Threading.Tasks;
2
using DurableTask.Core;
3
using LLL.DurableTask.Core.Serializing;
4

5
namespace LLL.DurableTask.Worker
6
{
7
    public abstract class OrchestrationBase<TResult, TInput> : TaskOrchestration
8
    {
9
        public ExtendedOrchestrationContext Context { get; private set; }
127✔
10

11
        public sealed override async Task<string> Execute(OrchestrationContext context, string input)
12
        {
13
            context.MessageDataConverter = new TypelessJsonDataConverter();
21✔
14
            context.ErrorDataConverter = new TypelessJsonDataConverter();
21✔
15
            Context = new ExtendedOrchestrationContext(context);
21✔
16

17
            var parameter = context.MessageDataConverter.Deserialize<TInput>(input);
21✔
18

19
            var result = await Execute(parameter);
21✔
20
            return context.MessageDataConverter.Serialize(result);
17✔
21
        }
22

23
        public sealed override string GetStatus()
24
        {
25
            if (Context.StatusProvider != null)
37✔
26
                return Context.StatusProvider();
×
27

28
            return Context.MessageDataConverter.Serialize(OnGetStatus());
37✔
29
        }
30

31
        public sealed override void RaiseEvent(OrchestrationContext context, string name, string input)
32
        {
33
            Context.RaiseEvent(name, input);
7✔
34
        }
35

36
        public abstract Task<TResult> Execute(TInput input);
37

38
        public virtual object OnGetStatus()
39
        {
40
            return null;
37✔
41
        }
42
    }
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc