/// <summary> /// Use custom, user defined interceptor. /// </summary> /// <param name="interceptor">User defined interceptor which implements <see cref="ISnapshotStoreInterceptor"/> interface.</param> /// <exception cref="ArgumentNullException">When <paramref name="interceptor"/> is <c>null</c>.</exception> public Task SetInterceptorAsync(ISnapshotStoreInterceptor interceptor) { if (interceptor == null) { throw new ArgumentNullException(nameof(interceptor)); } return(Setter.SetInterceptorAsync(interceptor)); }
protected override bool ReceivePluginInternal(object message) { switch (message) { case UseSaveInterceptor use: _saveInterceptor = use.Interceptor; Sender.Tell(Ack.Instance); return(true); case UseLoadInterceptor use: _loadInterceptor = use.Interceptor; Sender.Tell(Ack.Instance); return(true); case UseDeleteInterceptor use: _deleteInterceptor = use.Interceptor; Sender.Tell(Ack.Instance); return(true); default: return(base.ReceivePluginInternal(message)); } }
public Task SetInterceptorAsync(ISnapshotStoreInterceptor interceptor) => _snapshots.Ask <TestSnapshotStore.Ack>( new TestSnapshotStore.UseDeleteInterceptor(interceptor), TimeSpan.FromSeconds(3) );
public OnCondition(Func <string, SnapshotSelectionCriteria, bool> predicate, ISnapshotStoreInterceptor next, bool negate = false) { _predicate = (persistenceId, criteria) => Task.FromResult(predicate(persistenceId, criteria)); _next = next; _negate = negate; }
public OnCondition(Func <string, SnapshotSelectionCriteria, Task <bool> > predicate, ISnapshotStoreInterceptor next, bool negate = false) { _predicate = predicate; _next = next; _negate = negate; }
public Delay(TimeSpan delay, ISnapshotStoreInterceptor next) { _delay = delay; _next = next; }
public UseSaveInterceptor(ISnapshotStoreInterceptor interceptor) { Interceptor = interceptor; }
public UseDeleteInterceptor(ISnapshotStoreInterceptor interceptor) { Interceptor = interceptor; }