public Worker( [NotNull] WorkerContext context, [NotNull] JobStorage storage, [NotNull] IJobPerformanceProcess process, [NotNull] IStateMachineFactory stateMachineFactory) { if (context == null) { throw new ArgumentNullException("context"); } if (storage == null) { throw new ArgumentNullException("storage"); } if (process == null) { throw new ArgumentNullException("process"); } if (stateMachineFactory == null) { throw new ArgumentNullException("stateMachineFactory"); } _context = context; _storage = storage; _process = process; _stateMachineFactory = stateMachineFactory; }
public static IStateMachineBuilderWithoutStateId <TContext, TStateId, TStatefulTask> FillWithTransitionsTable <TContext, TStateId, TStatefulTask>( this TStatefulTask initialTask, IStateMachineFactory <TContext, TStateId, TStatefulTask> factory) where TStatefulTask : class, IStatefulTask <TContext, TStateId> { return(factory.FillWithTransitionsTable(initialTask)); }
internal CreateContext( IStorageConnection connection, IStateMachineFactory stateMachineFactory, Job job, IState initialState) { if (connection == null) { throw new ArgumentNullException("connection"); } if (stateMachineFactory == null) { throw new ArgumentNullException("stateMachineFactory"); } if (job == null) { throw new ArgumentNullException("job"); } if (initialState == null) { throw new ArgumentNullException("initialState"); } _stateMachineFactory = stateMachineFactory; Connection = connection; Job = job; InitialState = initialState; Items = new Dictionary <string, object>(); }
public CompetitionWorkflow(Competition competition, IStateMachineFactory <Competition, ECompetitionState, ECompetitionEvent> stateMachineFactory, IStateMachineConfigurator <Competition, ECompetitionState, ECompetitionEvent> stateMachineConfigurator) : base(competition, stateMachineFactory, stateMachineConfigurator) { }
public StateMachineFactoryTests() { this.core = Mock.Of <IStateMachineCore>(MockBehavior.Strict); this.factory = new StateMachineFactory <string>(new ConcurrentDictionary <string, Func <IStateMachineCore> >(new[] { new KeyValuePair <string, Func <IStateMachineCore> >("TEST", () => this.core) })); }
public TravelRequestWorkflow_SimpleWithConfigurators(IStateMachineFactory stateMachineFactory) { if (stateMachineFactory == null) { throw new ArgumentNullException(nameof(stateMachineFactory)); } _stateMachineFactory = stateMachineFactory; }
public StateEngine( IStateMachineFactory <TState, TInput> stateMachineFactory, IRepositoryContextFactory <TState, TInput> repositoryContextFactory, IConnectorResolver <TState, TInput> connectorResolver, IEnumerable <IEventListener> listeners) { _stateMachineFactory = stateMachineFactory; _repositoryContextFactory = repositoryContextFactory; ConnectorResolver = connectorResolver; _listeners = listeners.ToList(); }
public SchedulePoller( JobStorage storage, IStateMachineFactory stateMachineFactory, TimeSpan pollInterval) { if (storage == null) throw new ArgumentNullException("storage"); if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory"); _storage = storage; _stateMachineFactory = stateMachineFactory; _pollInterval = pollInterval; }
public StateEngineFactory( IStateMachineFactory stateMachineFactory, IRepositoryContextFactory repositoryContextFactory, StringSerializer stringSerializer, IPlatformLogger logger) { _StateMachineFactory = stateMachineFactory; _RepositoryContextFactory = repositoryContextFactory; _StringSerializer = stringSerializer; _Logger = logger; }
/// <summary> /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class /// with a specified job storage and job creation process. /// </summary> /// /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception> /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception> public BackgroundJobClient( JobStorage storage, IStateMachineFactory stateMachineFactory, IJobCreationProcess process) { if (storage == null) throw new ArgumentNullException("storage"); if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory"); if (process == null) throw new ArgumentNullException("process"); _connection = storage.GetConnection(); _stateMachineFactory = stateMachineFactory; _process = process; }
public StatelessWorkflowProvider(IStateMachineFactory <TObject, TState, TEvent> stateMachineFactory, IStateMachineConfigurator <TObject, TState, TEvent> stateMachineConfigurator) { if (stateMachineFactory == null) { throw new ArgumentNullException(nameof(stateMachineFactory)); } if (stateMachineConfigurator == null) { throw new ArgumentNullException(nameof(stateMachineConfigurator)); } StateMachineFactory = stateMachineFactory; StateMachineConfigurator = stateMachineConfigurator; }
public Worker( [NotNull] WorkerContext context, [NotNull] JobStorage storage, [NotNull] IJobPerformanceProcess process, [NotNull] IStateMachineFactory stateMachineFactory) { if (context == null) throw new ArgumentNullException("context"); if (storage == null) throw new ArgumentNullException("storage"); if (process == null) throw new ArgumentNullException("process"); if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory"); _context = context; _storage = storage; _process = process; _stateMachineFactory = stateMachineFactory; }
public StateEngine( IStateMachineFactory stateMachineFactory, IRepositoryContextFactory repositoryContextFactory, StringSerializer stringSerializer, IPlatformLogger logger, string apiKey) { _stateMachineFactory = stateMachineFactory; _repositoryContextFactory = repositoryContextFactory; _stringSerializer = stringSerializer; _Logger = logger; _apiKey = apiKey; }
public SchedulePoller( JobStorage storage, IStateMachineFactory stateMachineFactory, TimeSpan pollInterval) { if (storage == null) { throw new ArgumentNullException("storage"); } if (stateMachineFactory == null) { throw new ArgumentNullException("stateMachineFactory"); } _storage = storage; _stateMachineFactory = stateMachineFactory; _pollInterval = pollInterval; }
protected StatelessWorkflow(TObject @object, IStateMachineFactory <TObject, TState, TEvent> stateMachineFactory, IStateMachineConfigurator <TObject, TState, TEvent> stateMachineConfigurator) { if (@object == null) { throw new ArgumentNullException(nameof(@object)); } if (stateMachineFactory == null) { throw new ArgumentNullException(nameof(stateMachineFactory)); } if (stateMachineConfigurator == null) { throw new ArgumentNullException(nameof(stateMachineConfigurator)); } _stateMachineFactory = stateMachineFactory; _stateMachineConfigurator = stateMachineConfigurator; Object = @object; }
internal SharedWorkerContext( string serverId, string[] queues, JobStorage storage, IJobPerformanceProcess performanceProcess, JobActivator activator, IStateMachineFactory stateMachineFactory) { if (serverId == null) { throw new ArgumentNullException("serverId"); } if (queues == null) { throw new ArgumentNullException("queues"); } if (storage == null) { throw new ArgumentNullException("storage"); } if (performanceProcess == null) { throw new ArgumentNullException("performanceProcess"); } if (activator == null) { throw new ArgumentNullException("activator"); } if (stateMachineFactory == null) { throw new ArgumentNullException("stateMachineFactory"); } ServerId = serverId; Queues = queues; Storage = storage; PerformanceProcess = performanceProcess; Activator = activator; StateMachineFactory = stateMachineFactory; }
internal SharedWorkerContext( string serverId, string[] queues, JobStorage storage, IJobPerformanceProcess performanceProcess, JobActivator activator, IStateMachineFactory stateMachineFactory) { if (serverId == null) throw new ArgumentNullException("serverId"); if (queues == null) throw new ArgumentNullException("queues"); if (storage == null) throw new ArgumentNullException("storage"); if (performanceProcess == null) throw new ArgumentNullException("performanceProcess"); if (activator == null) throw new ArgumentNullException("activator"); if (stateMachineFactory == null) throw new ArgumentNullException("stateMachineFactory"); ServerId = serverId; Queues = queues; Storage = storage; PerformanceProcess = performanceProcess; Activator = activator; StateMachineFactory = stateMachineFactory; }
/// <summary> /// Initializes a new instance of the <see cref="BackgroundJobClient"/> class /// with a specified job storage and job creation process. /// </summary> /// /// <exception cref="ArgumentNullException"><paramref name="storage"/> argument is null.</exception> /// <exception cref="ArgumentNullException"><paramref name="process"/> argument is null.</exception> public BackgroundJobClient( JobStorage storage, IStateMachineFactory stateMachineFactory, IJobCreationProcess process) { if (storage == null) { throw new ArgumentNullException("storage"); } if (stateMachineFactory == null) { throw new ArgumentNullException("stateMachineFactory"); } if (process == null) { throw new ArgumentNullException("process"); } _storage = storage; _stateMachineFactory = stateMachineFactory; _process = process; }
public static IStateMachine <TState, TData> Create <TState, TData>(this IStateMachineFactory factory, TState state, TData data) where TState : struct { return(factory.Create(Options.DefaultName, state, data)); }
public static IStateMachine <int, TData> Create <TData>(this IStateMachineFactory factory, string name, TData data) => factory.Create(name, 0, data);
public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory) : this(storage, stateMachineFactory, JobCreationProcess.Instance) { }
// NOTE: Inject Competition repository etc public CompetitionWorkflowProvider(IStateMachineFactory <Competition, ECompetitionState, ECompetitionEvent> stateMachineFactory, IStateMachineConfigurator <Competition, ECompetitionState, ECompetitionEvent> stateMachineConfigurator) : base(stateMachineFactory, stateMachineConfigurator) { }
public static IStateMachine <int, TData> Create <TData>(this IStateMachineFactory factory, TData data) => factory.Create(Options.DefaultName, data);
public BackgroundJobClient(JobStorage storage, IStateMachineFactory stateMachineFactory) : this(storage, stateMachineFactory, DefaultJobCreationProcess.Instance) { }
internal TransitionInfo(IStateMachineFactory <TState, TInput> stateMachineFactory) { _factory = stateMachineFactory; _guards = new List <ITransitionGuard <TState, TInput> >(); }