Beispiel #1
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                // The current assumption is that in-proc (.NET) apps always use
                // IEntityContext or some derivative. Non-.NET apps
                // which cannot use these types are therefore assumed to be "out-of-proc".
                // We may need to revisit this assumption when Functions v2 adds support
                // for "out-of-proc" .NET.
                var isOutOfProc = !typeof(IDurableEntityContext).IsAssignableFrom(this.parameterInfo.ParameterType);

                this.config.RegisterEntity(this.entityName, new RegisteredFunctionInfo(context.Executor, isOutOfProc));

                var listener = new DurableTaskListener(
                    this.config,
                    context.Descriptor.Id,
                    this.entityName,
                    context.Executor,
                    FunctionType.Entity,
                    this.storageConnectionString);

                return(Task.FromResult <IListener>(listener));
            }
Beispiel #2
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                var listener = new DurableTaskListener(
                    this.config,
                    this.orchestratorName,
                    context.Executor,
                    isOrchestrator: true);

                return(Task.FromResult <IListener>(listener));
            }
Beispiel #3
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                var listener = DurableTaskListener.CreateForOrchestration(
                    this.config,
                    this.orchestrationName,
                    this.version,
                    context.Executor);

                return(Task.FromResult <IListener>(listener));
            }
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                var listener = DurableTaskListener.CreateForActivity(
                    this.parent.durableTaskConfig,
                    this.activityName,
                    this.activityVersion,
                    context.Executor);

                return(Task.FromResult <IListener>(listener));
            }
Beispiel #5
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                this.parent.durableTaskConfig.RegisterActivity(this.activityName, context.Executor);

                var listener = new DurableTaskListener(
                    this.parent.durableTaskConfig,
                    this.activityName,
                    context.Executor,
                    isOrchestrator: false);

                return(Task.FromResult <IListener>(listener));
            }
Beispiel #6
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                this.parent.durableTaskConfig.RegisterActivity(this.activityName, context.Executor);

                var listener = new DurableTaskListener(
                    this.parent.durableTaskConfig,
                    context.Descriptor.Id,
                    this.activityName,
                    context.Executor,
                    FunctionType.Activity,
                    this.parent.storageConnectionString);

                return(Task.FromResult <IListener>(listener));
            }
Beispiel #7
0
            public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
            {
                if (context == null)
                {
                    throw new ArgumentNullException(nameof(context));
                }

                // The current assumption is that in-proc (.NET) apps always use
                // DurableOrchestrationContextBase or some derivative. Non-.NET apps
                // which cannot use these types are therefore assumed to be "out-of-proc".
                // We may need to revisit this assumption when Functions v2 adds support
                // for "out-of-proc" .NET.
                var isOutOfProc = !typeof(DurableOrchestrationContextBase).IsAssignableFrom(this.parameterInfo.ParameterType);

                this.config.RegisterOrchestrator(this.orchestratorName, new OrchestratorInfo(context.Executor, isOutOfProc));

                var listener = new DurableTaskListener(
                    this.config,
                    this.orchestratorName,
                    context.Executor,
                    isOrchestrator: true);

                return(Task.FromResult <IListener>(listener));
            }