コード例 #1
0
ファイル: Mailbox.cs プロジェクト: crapitan/Fiffi
 public static Func <Func <IReliableStateManager, ITransaction, IEvent, Task>, CancellationToken, Task> Reader(this IReliableStateManager stateManager, Func <EventData, IEvent> deserializer, string mailBoxName)
 => async(f, token) =>
 {
     await stateManager.UseTransactionAsync(tx =>
                                            stateManager.DequeueAsync(
                                                tx,
                                                e => f(stateManager, tx, e),
                                                deserializer,
                                                token, queueName: mailBoxName)
                                            );
 };
コード例 #2
0
 public static Task DequeueAsync <T>(this IReliableStateManager stateManager, Func <T, Task> action,
                                     Func <EventData, T> deserializer,
                                     CancellationToken cancellationToken, string queueName = defaultOutBoxQueueName)
 => stateManager.UseTransactionAsync(tx => stateManager.DequeueAsync(tx, action, deserializer, cancellationToken, true, queueName), autoCommit: false);
コード例 #3
0
 public static Task EnqueuAsync <T>(this IReliableStateManager stateManager, IEnumerable <T> events, Func <T, EventData> serialzer, string queueName = defaultOutBoxQueueName)
     where T : IEvent
 => stateManager.UseTransactionAsync(tx => stateManager.EnqueuAsync(tx, events, serialzer, queueName));
コード例 #4
0
 //TODO move to queue etx
 public static Task EnqueuAsync(this IReliableStateManager stateManager, IEvent @event, Func <IEvent, EventData> serialzer, string queueName)
 => stateManager.UseTransactionAsync(tx => stateManager.EnqueuAsync(tx, new[] { @event }, serialzer, queueName));