[ci skip] Fixed #14: Clarify error when yielding a parallel request builder without requests
Did not implement the short-circuit to the converge method yet, as that would circumvent the controller check. Maybe later.
This commit is contained in:
parent
a74924af90
commit
25c01ee1ed
@ -290,6 +290,9 @@ namespace Tapeti.Flow.Default
|
|||||||
|
|
||||||
private IYieldPoint BuildYieldPoint(Delegate convergeMethod, bool convergeMethodSync)
|
private IYieldPoint BuildYieldPoint(Delegate convergeMethod, bool convergeMethodSync)
|
||||||
{
|
{
|
||||||
|
if (requests.Count == 0)
|
||||||
|
throw new YieldPointException("At least one request must be added before yielding a parallel request");
|
||||||
|
|
||||||
if (convergeMethod?.Method == null)
|
if (convergeMethod?.Method == null)
|
||||||
throw new ArgumentNullException(nameof(convergeMethod));
|
throw new ArgumentNullException(nameof(convergeMethod));
|
||||||
|
|
||||||
|
@ -251,12 +251,10 @@ A few things to note:
|
|||||||
|
|
||||||
#) The response handlers do not return an IYieldPoint themselves, but void (for AddRequestSync) or Task (for AddRequest). Therefore they can not influence the flow. Instead the converge method as passed to Yield or YieldSync determines how the flow continues. It is called immediately after the last response handler.
|
#) The response handlers do not return an IYieldPoint themselves, but void (for AddRequestSync) or Task (for AddRequest). Therefore they can not influence the flow. Instead the converge method as passed to Yield or YieldSync determines how the flow continues. It is called immediately after the last response handler.
|
||||||
#) The converge method must be private, as it is not a valid message handler in itself.
|
#) The converge method must be private, as it is not a valid message handler in itself.
|
||||||
|
#) You must add at least one request.
|
||||||
|
|
||||||
Note that you do not have to perform all the operations in one go. You can store the result of ``YieldWithParallelRequest`` and conditionally call ``AddRequest`` or ``AddRequestSync`` as many times as required.
|
Note that you do not have to perform all the operations in one go. You can store the result of ``YieldWithParallelRequest`` and conditionally call ``AddRequest`` or ``AddRequestSync`` as many times as required.
|
||||||
|
|
||||||
.. warning:: At the time of writing, you must add at least one request to the parallel request builder before yielding or your flow will halt. This will hopefully be fixed in the future.
|
|
||||||
|
|
||||||
|
|
||||||
Persistent state
|
Persistent state
|
||||||
----------------
|
----------------
|
||||||
|
@ -132,6 +132,7 @@ The routing key is determined by converting CamelCase to dot-separated lowercase
|
|||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
This behaviour is implemented using the IRoutingKeyStrategy interface. For more information about changing this, see `Overriding default behaviour`_
|
This behaviour is implemented using the IRoutingKeyStrategy interface. For more information about changing this, see `Overriding default behaviour`_
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user