/
vshmidt
/
masstransit
Обзор
Документация
Войти
/
vshmidt
/
masstransit
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
src/MassTransit.Abstractions/Futures/FutureState.cs
133 строки
3 KB
Sam Critchley
FIX #3352 FutureState deserialization
12 май 2022, 06:59
12 май 2022, 06:59
57ebdb4
Код
Авторство
О чём код?
#nullable disable namespace MassTransit { using System; using System.Collections.Generic; public class FutureState : SagaStateMachineInstance, ISagaVersion { Dictionary<Guid, FutureMessage> _faults; HashSet<Guid> _pending; Dictionary<Guid, FutureMessage> _results; HashSet<FutureSubscription> _subscriptions; Dictionary<string, object> _variables; public int CurrentState { get; set; } public DateTime Created { get; set; } public DateTime? Completed { get; set; } public DateTime? Faulted { get; set; } public Uri Location { get; set; } public FutureMessage Command { get; set; } public HashSet<Guid> Pending { get { if (_pending != null) return _pending; lock (this) _pending ??= new HashSet<Guid>(); return _pending; } set => _pending = value; } public HashSet<FutureSubscription> Subscriptions { get { if (_subscriptions != null) return _subscriptions; lock (this) _subscriptions ??= new HashSet<FutureSubscription>(FutureSubscription.Comparer); return _subscriptions; } set => _subscriptions = value; } public Dictionary<string, object> Variables { get { if (_variables != null) return _variables; lock (this) _variables ??= new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase); return _variables; } set => _variables = value != null ? new Dictionary<string, object>(value, StringComparer.OrdinalIgnoreCase) : null; } public Dictionary<Guid, FutureMessage> Results { get { if (_results != null) return _results; lock (this) _results ??= new Dictionary<Guid, FutureMessage>(); return _results; } set => _results = value; } public Dictionary<Guid, FutureMessage> Faults { get { if (_faults != null) return _faults; lock (this) _faults ??= new Dictionary<Guid, FutureMessage>(); return _faults; } set => _faults = value; } public byte[] RowVersion { get; set; } public int Version { get; set; } public Guid CorrelationId { get; set; } public bool HasSubscriptions() { return _subscriptions != null && _subscriptions.Count > 0; } public bool HasVariables() { return _variables != null && _variables.Count > 0; } public bool HasResults() { return _results != null && _results.Count > 0; } public bool HasFaults() { return _faults != null && _faults.Count > 0; } public bool HasPending() { return _pending != null && _pending.Count > 0; } } }