Permalink
Browse files

Deprecate obsolete SubscribeToStreamFrom and SubscribeToAllFrom funct…

…ions
  • Loading branch information...
shaan1337 committed Jan 28, 2019
1 parent a9eac03 commit cd83cd131f731a7af6b02f9ba263b6053bf7f348
@@ -234,50 +234,6 @@ public interface IEventStoreConnection : IDisposable
Action<EventStoreSubscription, SubscriptionDropReason, Exception> subscriptionDropped = null,
UserCredentials userCredentials = null);

/// <summary>
/// Subscribes to a single event stream. Existing events from
/// lastCheckpoint onwards are read from the stream
/// and presented to the user of <see cref="EventStoreCatchUpSubscription"/>
/// as if they had been pushed.
///
/// Once the end of the stream is read the subscription is
/// transparently (to the user) switched to push new events as
/// they are written.
///
/// The action liveProcessingStarted is called when the
/// <see cref="EventStoreCatchUpSubscription"/> switches from the reading
/// phase to the live subscription phase.
/// </summary>
/// <param name="stream">The stream to subscribe to</param>
/// <param name="lastCheckpoint">The event number from which to start.
///
/// To receive all events in the stream, use <see cref="StreamCheckpoint.StreamStart" />.
/// If events have already been received and resubscription from the same point
/// is desired, use the event number of the last event processed which
/// appeared on the subscription.
///
/// Using <see cref="StreamPosition.Start" /> here will result in missing
/// the first event in the stream.</param>
/// <param name="resolveLinkTos">Whether to resolve Link events automatically.</param>
/// <param name="eventAppeared">A Task invoked and awaited when a new event is received over the subscription.</param>
/// <param name="liveProcessingStarted">An action invoked when the subscription switches to newly-pushed events.</param>
/// <param name="subscriptionDropped">An action invoked if the subscription is dropped.</param>
/// <param name="userCredentials">User credentials to use for the operation.</param>
/// <param name="readBatchSize">The batch size to use during the read phase.</param>
/// <param name="subscriptionName">The name of subscription.</param>
/// <returns>An <see cref="EventStoreStreamCatchUpSubscription"/> representing the subscription.</returns>
[Obsolete("This method will be obsoleted in the next major version please switch to the overload with a settings object")]
EventStoreStreamCatchUpSubscription SubscribeToStreamFrom(
string stream,
long? lastCheckpoint,
bool resolveLinkTos,
Func<EventStoreCatchUpSubscription, ResolvedEvent, Task> eventAppeared,
Action<EventStoreCatchUpSubscription> liveProcessingStarted = null,
Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped = null,
UserCredentials userCredentials = null,
int readBatchSize = 500,
string subscriptionName = "");

/// <summary>
/// Subscribes to a single event stream. Existing events from
/// lastCheckpoint onwards are read from the stream
@@ -416,47 +372,6 @@ public interface IEventStoreConnection : IDisposable
bool autoAck = true);
*/

/// <summary>
/// Subscribes to all events. Existing events from lastCheckpoint
/// onwards are read from Event Store and presented to the user of
/// <see cref="EventStoreCatchUpSubscription"/> as if they had been pushed.
///
/// Once the end of the stream is read the subscription is
/// transparently (to the user) switched to push new events as
/// they are written.
///
/// The action liveProcessingStarted is called when the
/// <see cref="EventStoreCatchUpSubscription"/> switches from the reading
/// phase to the live subscription phase.
/// </summary>
/// <param name="lastCheckpoint">The position from which to start.
///
/// To receive all events in the database, use <see cref="AllCheckpoint.AllStart" />.
/// If events have already been received and resubscription from the same point
/// is desired, use the position representing the last event processed which
/// appeared on the subscription.
///
/// Using <see cref="Position.Start" /> here will result in missing
/// the first event in the stream.</param>
/// <param name="resolveLinkTos">Whether to resolve Link events automatically.</param>
/// <param name="eventAppeared">A Task invoked and awaited when a new event is received over the subscription.</param>
/// <param name="liveProcessingStarted">An action invoked when the subscription switches to newly-pushed events.</param>
/// <param name="subscriptionDropped">An action invoked if the subscription is dropped.</param>
/// <param name="userCredentials">User credentials to use for the operation.</param>
/// <param name="readBatchSize">The batch size to use during the read phase.</param>
/// <param name="subscriptionName">The name of subscription.</param>
/// <returns>An <see cref="EventStoreAllCatchUpSubscription"/> representing the subscription.</returns>
[Obsolete("This overload will be removed in the next major release please use the overload with a settings object")]
EventStoreAllCatchUpSubscription SubscribeToAllFrom(
Position? lastCheckpoint,
bool resolveLinkTos,
Func<EventStoreCatchUpSubscription, ResolvedEvent, Task> eventAppeared,
Action<EventStoreCatchUpSubscription> liveProcessingStarted = null,
Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped = null,
UserCredentials userCredentials = null,
int readBatchSize = 500,
string subscriptionName = "");

/// <summary>
/// Subscribes to a all events. Existing events from lastCheckpoint
/// onwards are read from Event Store and presented to the user of
@@ -44,63 +44,6 @@ public static class IEventStoreConnectionExtensions
userCredentials
);

/// <summary>
/// Subscribes to a single event stream. Existing events from
/// lastCheckpoint onwards are read from the stream
/// and presented to the user of <see cref="EventStoreCatchUpSubscription"/>
/// as if they had been pushed.
///
/// Once the end of the stream is read the subscription is
/// transparently (to the user) switched to push new events as
/// they are written.
///
/// The action liveProcessingStarted is called when the
/// <see cref="EventStoreCatchUpSubscription"/> switches from the reading
/// phase to the live subscription phase.
/// </summary>
/// <param name="stream">The stream to subscribe to</param>
/// <param name="lastCheckpoint">The event number from which to start.
///
/// To receive all events in the stream, use <see cref="StreamCheckpoint.StreamStart" />.
/// If events have already been received and resubscription from the same point
/// is desired, use the event number of the last event processed which
/// appeared on the subscription.
///
/// NOTE: Using <see cref="StreamPosition.Start" /> here will result in missing
/// the first event in the stream.</param>
/// <param name="target">The connection to subscribe to</param>
/// <param name="resolveLinkTos">Whether to resolve Link events automatically</param>
/// <param name="eventAppeared">An action invoked when a new event is received over the subscription</param>
/// <param name="liveProcessingStarted">An action invoked when the subscription switches to newly-pushed events</param>
/// <param name="subscriptionDropped">An action invoked if the subscription is dropped</param>
/// <param name="userCredentials">User credentials to use for the operation</param>
/// <param name="readBatchSize">The batch size to use during the read phase</param>
/// <param name="subscriptionName">The name of subscription</param>
/// <returns>An <see cref="EventStoreSubscription"/> representing the subscription</returns>
[Obsolete("This method will be obsoleted in the next major version please switch to the overload with a settings object")]
public static EventStoreStreamCatchUpSubscription SubscribeToStreamFrom(
this IEventStoreConnection target,
string stream,
long? lastCheckpoint,
bool resolveLinkTos,
Action<EventStoreCatchUpSubscription, ResolvedEvent> eventAppeared,
Action<EventStoreCatchUpSubscription> liveProcessingStarted = null,
Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped = null,
UserCredentials userCredentials = null,
int readBatchSize = 500,
string subscriptionName = "") =>
target.SubscribeToStreamFrom(
stream,
lastCheckpoint,
resolveLinkTos,
ToTask(eventAppeared),
liveProcessingStarted,
subscriptionDropped,
userCredentials,
readBatchSize,
subscriptionName
);

/// <summary>
/// Subscribes to a single event stream. Existing events from
/// lastCheckpoint onwards are read from the stream
@@ -326,57 +269,6 @@ public static class IEventStoreConnectionExtensions
autoAck
);

/// <summary>
/// Subscribes to all events. Existing events from lastCheckpoint
/// onwards are read from the Event Store and presented to the user of
/// <see cref="EventStoreCatchUpSubscription"/> as if they had been pushed.
///
/// Once the end of the stream is read the subscription is
/// transparently (to the user) switched to push new events as
/// they are written.
///
/// The action liveProcessingStarted is called when the
/// <see cref="EventStoreCatchUpSubscription"/> switches from the reading
/// phase to the live subscription phase.
/// </summary>
/// <param name="lastCheckpoint">The position from which to start.
///
/// To receive all events in the database, use <see cref="AllCheckpoint.AllStart" />.
/// If events have already been received and resubscription from the same point
/// is desired, use the position representing the last event processed which
/// appeared on the subscription.
///
/// NOTE: Using <see cref="Position.Start" /> here will result in missing
/// the first event in the stream.</param>
/// <param name="target">The connection to subscribe to</param>
/// <param name="resolveLinkTos">Whether to resolve Link events automatically</param>
/// <param name="eventAppeared">An action invoked when a new event is received over the subscription</param>
/// <param name="liveProcessingStarted">An action invoked when the subscription switches to newly-pushed events</param>
/// <param name="subscriptionDropped">An action invoked if the subscription is dropped</param>
/// <param name="userCredentials">User credentials to use for the operation</param>
/// <param name="readBatchSize">The batch size to use during the read phase</param>
/// <param name="subscriptionName">The name of subscription</param>
/// <returns>An <see cref="EventStoreSubscription"/> representing the subscription</returns>
[Obsolete("This overload will be removed in the next major release please use the overload with a settings object")]
public static EventStoreAllCatchUpSubscription SubscribeToAllFrom(
this IEventStoreConnection target,
Position? lastCheckpoint,
bool resolveLinkTos,
Action<EventStoreCatchUpSubscription, ResolvedEvent> eventAppeared,
Action<EventStoreCatchUpSubscription> liveProcessingStarted = null,
Action<EventStoreCatchUpSubscription, SubscriptionDropReason, Exception> subscriptionDropped = null,
UserCredentials userCredentials = null,
int readBatchSize = 500,
string subscriptionName = "") =>
target.SubscribeToAllFrom(
lastCheckpoint,
resolveLinkTos,
ToTask(eventAppeared),
liveProcessingStarted,
subscriptionDropped,
userCredentials
);

/// <summary>
/// Subscribes to a all events. Existing events from lastCheckpoint
/// onwards are read from the Event Store and presented to the user of

0 comments on commit cd83cd1

Please sign in to comment.