question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Multiple event subscription

See original GitHub issue

Hello @danielgerlag, Thanks all your hard work done and sharing it here. I want to know whether is it possible to subscribe a step to multiple events and provide a loopback as sample shown below. builder .StartWith<CreateUser>() .Input(step => step.Email, data => data.Email) .Input(step => step.Password, data => data.Password) .Output(data => data.UserId, step => step.UserId) .Then<SendConfirmationEmail>(sendConfirmation => { sendConfirmation .WaitFor("confirmation", data => data.UserId) .Then<UpdateUser>() .Input(step => step.UserId, data => data.UserId) .EndWorkflow(); sendConfirmation.WaitFor("resendConfirmation", data => data.UserId).Then(sendConfirmation); });

Best Regards, Nurhat

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
qazqcommented, Jun 8, 2017

In my design, I keep all the related data in the EFormData and it will be stored in the persistence database. But I cannot modify approval result for specific approver easily.

.WaitFor("approval", data => data.FormId, data => DateTime.Now)
    .Output(data => data.Approvers[N], step => step.EventData)  // N is dynamic

The N is dynamic depends on which approver published the event. My current solution is to modify EFromData in the database directly and then publish the event.

            var workflow = _host.PersistenceStore.GetWorkflowInstance(workflowId).Result;
            var form = workflow.Data as EFormData;

            form.Approvers.Find(a => a.UserId == approverUserId).Result = FormApprovalResult.Approved;
            _host.PersistenceStore.PersistWorkflow(workflow);

            _host.PublishEvent("approval", form.FormId, null);

I don’t think this is a good approach. Do you have any suggestions? Thank you.

0reactions
danielgerlagcommented, Jun 13, 2020

Could you vary the key by making it compound?

Read more comments on GitHub >

github_iconTop Results From Across the Web

azure event grid data flow for multiple subscriptions to ...
Hi, Consider I have the following scenario: So I have 2 different subscriptions: sub1, sub2 both subscribed to the same storage account and ......
Read more >
How to subscribe to an Event in C# and can we have ...
An event can have multiple subscribers. A subscriber can handle multiple events from multiple publishers. Events that have no subscribers ...
Read more >
c# - when an event has multiple subscribers, how do I get ...
Use Delegate.GetInvocationList . if (SecondChange != null) { DateTime now = DateTime.Now; foreach (Delegate d in SecondChange.
Read more >
c# - Should I use: One event multiple subscribers or ...
I wondering whether I should use one event multiple subscribers or multiple events multiple subscribers. I am worried about performance.
Read more >
Route Azure Storage Events to Multiple Subscribers
This blog discusses how to route Azure Storage Events to multiple subscribers with Event Grid which is the latest sensation in the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found