2026-09-04 14:03:41 +03:00
|
|
|
using System;
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
|
|
|
|
|
namespace RudderSdk.Core;
|
|
|
|
|
|
|
|
|
|
/// <summary>A scenario wait node. The run resumes when the server advances it at <see cref="DeadlineUtc"/>.</summary>
|
|
|
|
|
public sealed class WaitEffect
|
|
|
|
|
{
|
|
|
|
|
private readonly EffectHandle _handle;
|
|
|
|
|
|
|
|
|
|
internal WaitEffect(EffectHandle handle, DateTimeOffset deadlineUtc)
|
|
|
|
|
{
|
|
|
|
|
_handle = handle;
|
|
|
|
|
DeadlineUtc = deadlineUtc;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>Run id.</summary>
|
|
|
|
|
public string RunId => _handle.RunId;
|
|
|
|
|
|
|
|
|
|
/// <summary>Scenario id.</summary>
|
2026-09-06 22:25:32 +03:00
|
|
|
public string ScenarioSlug => _handle.ScenarioSlug;
|
2026-09-04 14:03:41 +03:00
|
|
|
|
|
|
|
|
/// <summary>Node id.</summary>
|
|
|
|
|
public string NodeId => _handle.NodeId;
|
|
|
|
|
|
|
|
|
|
/// <summary>When the wait ends (UTC).</summary>
|
|
|
|
|
public DateTimeOffset DeadlineUtc { get; }
|
|
|
|
|
|
|
|
|
|
/// <summary>Node data payload.</summary>
|
|
|
|
|
public JObject Data => _handle.Data;
|
|
|
|
|
|
|
|
|
|
/// <summary>Reads a typed value from the node data.</summary>
|
|
|
|
|
public T Get<T>(string key, T defaultValue = default!) => _handle.Get(key, defaultValue);
|
|
|
|
|
}
|