Files
rudder-csharp-sdk/Services/Scenarios/Sessions/NotificationSession.cs
T
2026-08-12 14:04:55 +03:00

26 lines
966 B
C#

using System.Threading;
using System.Threading.Tasks;
namespace RudderSdk.Core;
/// <summary>Session of a scenario notification node.</summary>
public sealed class NotificationSession
{
internal NotificationSession(ScenarioNodeContext context) => Context = context;
/// <summary>Underlying node context.</summary>
public ScenarioNodeContext Context { get; }
/// <summary>Node id.</summary>
public string Id => Context.NodeId;
/// <summary>Reads a typed value from the node data.</summary>
public T Get<T>(string key, T defaultValue = default!) => Context.Get(key, defaultValue);
/// <summary>Advances the run through the output handle.</summary>
public Task CompleteAsync(CancellationToken cancellationToken = default) => Context.CompleteAsync("output", cancellationToken);
/// <summary>Advances the run through the output handle (fire-and-forget).</summary>
public void Complete() => Context.Complete("output");
}