Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obsolete Saga.RequestTimeout(Action<TTimeoutMessageType>) #2491

Closed
SimonCropp opened this issue Oct 18, 2014 · 3 comments · Fixed by #2498
Closed

Obsolete Saga.RequestTimeout(Action<TTimeoutMessageType>) #2491

SimonCropp opened this issue Oct 18, 2014 · 3 comments · Fixed by #2498
Milestone

Comments

@SimonCropp
Copy link
Contributor

Both have new() constraints and hence cannot be an interface. No need to construct an instance when the consumer can do this themselves.

RequestTimeout<TTimeoutMessageType>(TimeSpan within, Action<TTimeoutMessageType> messageConstructor) where TTimeoutMessageType : new()
RequestTimeout<TTimeoutMessageType>(DateTime at, Action<TTimeoutMessageType> action) where TTimeoutMessageType : new()
@SimonCropp
Copy link
Contributor Author

same for ReplyToOriginator<TMessage>(Action<TMessage> messageConstructor)

@johnsimons
Copy link
Member

@SimonCropp @andreasohlund,

I actually think we need to remove the new() constraints and also roll back #2498.
Users should be able to pass interfaces to those overload methods.

This is related to the issue that we have just patched not long ago regarding #2446.

So in summary users should be allowed to delay any incoming message including events.
So the following code should work:

public class MySaga : Saga<MySagaData>,
    IAmStartedByMessages<OrderShipped>,
    IHandleTimeouts<OrderShipped>
{
    public void Handle(OrderShipped message)
    {
        RequestTimeout<OrderShipped>(TimeSpan.FromSeconds(25), message);
    }

    public void Timeout(OrderShipped state)
    {

    }
}

interface OrderShipped : IEvent
{
}

@SimonCropp SimonCropp added this to the 5.1.0 milestone Oct 20, 2014
@andreasohlund
Copy link
Member

When you request the TM you already have the instantiated message?

Sent from my iPhone

On 19 Oct 2014, at 23:15, John Simons notifications@github.com wrote:

@SimonCropp @andreasohlund,

I actually think we need to remove the new() constraints and also roll back #2498.
Users should be able to pass interfaces to those overload methods.

This is related to the issue that we have just patched not long ago regarding #2446.

So in summary users should be allowed to delay any incoming message including events.
So the following code should work:

public class MySaga : Saga,
IAmStartedByMessages,
IHandleTimeouts
{
public void Handle(OrderShipped message)
{
RequestTimeout(TimeSpan.FromSeconds(25));
}

public void Timeout(OrderShipped state)
{

}

}

interface OrderShipped : IEvent
{
}

Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants