Example #1
0
 public static EventActivityBinder <JobSaga, JobAttemptCanceled> PublishJobCanceled(this EventActivityBinder <JobSaga, JobAttemptCanceled> binder)
 {
     return(binder.PublishAsync(context => context.Init <JobCanceled>(new
     {
         context.Data.JobId,
         context.Data.Timestamp
     })));
 }
 public static EventActivityBinder <Reservation, T> PublishReservationCancelled <T>(this EventActivityBinder <Reservation, T> binder)
     where T : class
 {
     return(binder.PublishAsync(context => context.Init <BookReservationCanceled>(new
     {
         ReservationId = context.Instance.CorrelationId,
         context.Instance.BookId
     })));
 }
Example #3
0
 public static EventActivityBinder <ReservationSaga, TMessage> PublishReservationCanceled <TMessage>(
     this EventActivityBinder <ReservationSaga, TMessage> me)
     where TMessage : class
 {
     return(me.PublishAsync(context => context.Init <BookReservationCanceled>(new
     {
         BookId = context.Instance.BookId,
         ReservationId = context.Instance.CorrelationId
     })));
 }
Example #4
0
 public static EventActivityBinder <JobSaga, Fault <StartJobAttempt> > PublishJobFaulted(this EventActivityBinder <JobSaga, Fault <StartJobAttempt> > binder)
 {
     return(binder.PublishAsync(context => context.Init <JobFaulted>(new
     {
         context.Data.Message.JobId,
         context.Data.Message.Job,
         context.Data.Timestamp,
         context.Data.Exceptions
     })));
 }
Example #5
0
 public static EventActivityBinder <JobSaga, JobAttemptFaulted> PublishJobFaulted(this EventActivityBinder <JobSaga, JobAttemptFaulted> binder)
 {
     return(binder.PublishAsync(context => context.Init <JobFaulted>(new
     {
         context.Data.JobId,
         context.Data.Exceptions,
         context.Data.Timestamp,
         context.Data.Job
     })));
 }
Example #6
0
 public static EventActivityBinder <JobSaga, JobAttemptStarted> PublishJobStarted(this EventActivityBinder <JobSaga, JobAttemptStarted> binder)
 {
     return(binder.PublishAsync(context => context.Init <JobStarted>(new
     {
         JobId = context.Instance.CorrelationId,
         context.Data.AttemptId,
         context.Data.RetryAttempt,
         context.Data.Timestamp
     })));
 }
Example #7
0
 public static EventActivityBinder <JobSaga, JobAttemptCompleted> PublishJobCompleted(this EventActivityBinder <JobSaga, JobAttemptCompleted> binder)
 {
     return(binder.PublishAsync(context => context.Init <JobCompleted>(new
     {
         JobId = context.Instance.CorrelationId,
         context.Instance.Job,
         context.Data.Timestamp,
         context.Data.Duration
     })));
 }
 public static EventActivityBinder <Book, ReservationRequested> PublishBookReserved(this EventActivityBinder <Book, ReservationRequested> binder)
 {
     return(binder.PublishAsync(context => context.Init <BookReserved>(new
     {
         context.Data.ReservationId,
         context.Data.MemberId,
         context.Data.Duration,
         context.Data.BookId,
         InVar.Timestamp
     })));
 }
 public static EventActivityBinder <JobAttemptSaga, T> PublishJobAttemptFaulted <T>(this EventActivityBinder <JobAttemptSaga, T> binder)
     where T : class
 {
     return(binder.PublishAsync(context => context.Init <JobAttemptFaulted>(new
     {
         context.Instance.JobId,
         context.Instance.CorrelationId,
         context.Instance.RetryAttempt,
         InVar.Timestamp
     })));
 }
 public static EventActivityBinder <JobAttemptSaga, Fault <StartJob> > PublishJobAttemptFaulted(
     this EventActivityBinder <JobAttemptSaga, Fault <StartJob> > binder)
 {
     return(binder.PublishAsync(context => context.Init <JobAttemptFaulted>(new
     {
         context.Instance.JobId,
         context.Instance.CorrelationId,
         context.Instance.RetryAttempt,
         context.Data.Timestamp,
         context.Data.Exceptions
     })));
 }
Example #11
0
 public static EventActivityBinder <JobSaga, JobAttemptFaulted> NotifyJobFaulted(this EventActivityBinder <JobSaga, JobAttemptFaulted> binder)
 {
     return(binder.PublishAsync(context => context.Init <JobFaulted>(new
     {
         JobId = context.Instance.CorrelationId,
         context.Instance.Job,
         context.Data.Exceptions,
         context.Data.Timestamp,
         Duration = context.Data.Timestamp - context.Instance.Started
     })).SendAsync(context => context.Instance.ServiceAddress,
                   context => context.Init <FaultJob>(new
     {
         JobId = context.Instance.CorrelationId,
         context.Instance.Job,
         context.Instance.AttemptId,
         context.Instance.RetryAttempt,
         context.Data.Exceptions,
         Duration = context.Data.Timestamp - context.Instance.Started
     })));
 }