Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/DurableTask.Core/Entities/ClientEntityHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ namespace DurableTask.Core.Entities
/// </summary>
public static class ClientEntityHelpers
{
/// <summary>
/// Create an event to represent an entity signal.
/// </summary>
/// <param name="targetInstance">The target instance.</param>
/// <param name="requestId">A unique identifier for the request.</param>
/// <param name="operationName">The name of the operation.</param>
/// <param name="input">The serialized input for the operation.</param>
/// <param name="scheduledTimeUtc">The time to schedule this signal, or null if not a scheduled signal</param>
/// <returns>The event to send.</returns>
public static EntityMessageEvent EmitOperationSignal(OrchestrationInstance targetInstance, Guid requestId, string operationName, string? input, (DateTime Original, DateTime Capped)? scheduledTimeUtc)
{
return EmitOperationSignal(targetInstance, requestId, operationName, input, scheduledTimeUtc, parentTraceContext: null, requestTime: null);
}

/// <summary>
/// Create an event to represent an entity signal.
/// </summary>
Expand All @@ -37,7 +51,7 @@ public static class ClientEntityHelpers
/// <param name="requestTime">The time at which the request was made.</param>
/// <param name="createTrace">Whether to create a trace for this signal operation.</param>
/// <returns>The event to send.</returns>
public static EntityMessageEvent EmitOperationSignal(OrchestrationInstance targetInstance, Guid requestId, string operationName, string? input, (DateTime Original, DateTime Capped)? scheduledTimeUtc, DistributedTraceContext? parentTraceContext = null, DateTimeOffset? requestTime = null, bool createTrace = false)
public static EntityMessageEvent EmitOperationSignal(OrchestrationInstance targetInstance, Guid requestId, string operationName, string? input, (DateTime Original, DateTime Capped)? scheduledTimeUtc, DistributedTraceContext? parentTraceContext, DateTimeOffset? requestTime, bool createTrace = false)
{
var request = new RequestMessage()
{
Expand Down
23 changes: 22 additions & 1 deletion src/DurableTask.Core/Entities/OrchestrationEntityContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,27 @@ public IEnumerable<EntityMessageEvent> EmitLockReleaseMessages()
}
}

/// <summary>
/// Creates a request message to be sent to an entity.
/// </summary>
/// <param name="target">The target entity.</param>
/// <param name="operationName">The name of the operation.</param>
/// <param name="oneWay">If true, this is a signal, otherwise it is a call.</param>
/// <param name="operationId">A unique identifier for this request.</param>
/// <param name="scheduledTimeUtc">A time for which to schedule the delivery, or null if this is not a scheduled message</param>
/// <param name="input">The operation input</param>
/// <returns>The event to send.</returns>
public EntityMessageEvent EmitRequestMessage(
OrchestrationInstance target,
string operationName,
bool oneWay,
Guid operationId,
(DateTime Original, DateTime Capped)? scheduledTimeUtc,
string? input)
{
return EmitRequestMessage(target, operationName, oneWay, operationId, scheduledTimeUtc, input, requestTime: null);
}

/// <summary>
/// Creates a request message to be sent to an entity.
/// </summary>
Expand All @@ -238,7 +259,7 @@ public EntityMessageEvent EmitRequestMessage(
Guid operationId,
(DateTime Original, DateTime Capped)? scheduledTimeUtc,
string? input,
DateTimeOffset? requestTime = null,
DateTimeOffset? requestTime,
bool createTrace = false)
{
this.CheckEntitySupport();
Expand Down
Loading