Example #1
0
        public static Task <SagaStorageFile> Open(Guid sagaId, SagaManifest manifest)
        {
            var filePath = manifest.GetFilePath(sagaId);

            if (!File.Exists(filePath))
            {
                return(noSagaFoundResult);
            }

            return(OpenWithDelayOnConcurrency(filePath, FileMode.Open));
        }
Example #2
0
        public static Task <SagaStorageFile> Open(Guid sagaId, SagaManifest manifest, CancellationToken cancellationToken = default)
        {
            var filePath = manifest.GetFilePath(sagaId);

            if (!File.Exists(filePath))
            {
                return(noSagaFoundResult);
            }

            return(OpenWithRetryOnConcurrency(filePath, FileMode.Open, cancellationToken));
        }
Example #3
0
        public static Task <SagaStorageFile> Create(Guid sagaId, SagaManifest manifest)
        {
            var filePath = manifest.GetFilePath(sagaId);

            return(OpenWithDelayOnConcurrency(filePath, FileMode.CreateNew));
        }
Example #4
0
        public static Task <SagaStorageFile> Create(Guid sagaId, SagaManifest manifest, CancellationToken cancellationToken = default)
        {
            var filePath = manifest.GetFilePath(sagaId);

            return(OpenWithRetryOnConcurrency(filePath, FileMode.CreateNew, cancellationToken));
        }