示例#1
0
 public static WorkflowOptions UseAwsKinesis(this WorkflowOptions options, AWSCredentials credentials, RegionEndpoint region, string appName, string streamName)
 {
     options.Services.AddTransient <IKinesisTracker>(sp => new KinesisTracker(credentials, region, "workflowcore_kinesis", sp.GetService <ILoggerFactory>()));
     options.Services.AddTransient <IKinesisStreamConsumer>(sp => new KinesisStreamConsumer(credentials, region, sp.GetService <IKinesisTracker>(), sp.GetService <IDistributedLockProvider>(), sp.GetService <ILoggerFactory>()));
     options.UseEventHub(sp => new KinesisProvider(credentials, region, appName, streamName, sp.GetService <IKinesisStreamConsumer>(), sp.GetService <ILoggerFactory>()));
     return(options);
 }
        public static WorkflowOptions UseAzureServiceBusEventHub(
            this WorkflowOptions options,
            string connectionString,
            string topicName,
            string subscriptionName)
        {
            options.UseEventHub(sp => new ServiceBusLifeCycleEventHub(
                                    connectionString, topicName, subscriptionName, sp.GetService <ILoggerFactory>()));

            return(options);
        }
 public static WorkflowOptions UseRedisEventHub(this WorkflowOptions options, string connectionString, string channel)
 {
     options.UseEventHub(sp => new RedisLifeCycleEventHub(connectionString, channel, sp.GetService <ILoggerFactory>()));
     return(options);
 }