public override async Task AfterEnter()
        {
            // Update asynchronously so that other threads receive the previous projection and don't wait for the update
            await Task.Factory.StartNew(async() => {
                // Make sure only one update action is done at a time
                using (await _syncLockFactory.Create().ConfigureAwait(false)) {
                    await _projectionDataService.UpdateProjection().ConfigureAwait(false);
                    _projectedData = await _projectionDataService.GetProjection().ConfigureAwait(false);
                }

                await _projectionSystem.MarkProjectionAsUpToDate().ConfigureAwait(false);
            }, CancellationToken.None, TaskCreationOptions.LongRunning, _taskScheduler)
            .ConfigureAwait(false);
        }
Exemplo n.º 2
0
 public override async Task AfterEnter()
 {
     await _projectionSystem.MarkProjectionAsUpToDate().ConfigureAwait(false);
 }