Beispiel #1
0
        public void StartJob(string type, string payload)
        {
            var cmd = new StartJobCommand
            {
                Name = type,
                Payload = payload
            };

            WebApiApplication.Bus.Send(cmd);
        }
Beispiel #2
0
        public static void StartJob(StartJobCommand command, IBus bus)
        {
            var job = new JobInstance
            {
                Id = Guid.NewGuid(),
                Name = command.Name,
                Payload = command.Payload
            };

            _jobs[job.Id] = job;

            job.Start(bus.Publish);
        }