/// <summary> /// Event Stream Listener /// i.e. $et-[MessageType] /// </summary> /// <param name="tMessage"></param> /// <param name="checkpoint"></param> /// <param name="blockUntilLive"></param> /// <param name="cancelWaitToken">Cancellation token to cancel waiting if blockUntilLive is true</param> public void Start( Type tMessage, long?checkpoint = null, bool blockUntilLive = false, CancellationToken cancelWaitToken = default(CancellationToken)) { if (!tMessage.IsSubclassOf(typeof(Event))) { throw new ArgumentException("type must derive from ReactiveDomain.Messaging.Event", nameof(tMessage)); } Start( _streamNameBuilder.GenerateForEventType(tMessage.Name), checkpoint, blockUntilLive, cancelWaitToken); }
/// <summary> /// Event Stream Listener /// i.e. $et-[MessageType] /// </summary> /// <param name="tMessage"></param> /// <param name="checkpoint"></param> /// <param name="blockUntilLive"></param> /// <param name="millisecondsTimeout"></param> public void Start( Type tMessage, long?checkpoint = null, bool blockUntilLive = false, int millisecondsTimeout = 1000) { if (!tMessage.IsSubclassOf(typeof(Event))) { throw new ArgumentException("type must derive from ReactiveDomain.Messaging.Event", nameof(tMessage)); } Start( _streamNameBuilder.GenerateForEventType(tMessage.Name), checkpoint, blockUntilLive, millisecondsTimeout); }
/// <summary> /// By Event Type Projection Reader /// i.e. $et-[MessageType] /// </summary> /// <param name="tMessage">The message type used to generate the stream (projection) name</param> /// <param name="checkpoint">The starting point to read from.</param> /// <param name="count">The count of items to read</param> /// <param name="readBackwards">Read the stream backwards</param> /// <returns>Returns true if any events were read from the stream</returns> /// <exception cref="ArgumentException"><paramref name="tMessage"/> must implement IMessage</exception> public bool Read( Type tMessage, long?checkpoint = null, long?count = null, bool readBackwards = false) { if (!typeof(IMessage).IsAssignableFrom(tMessage)) { throw new ArgumentException("tMessage must implement IMessage", nameof(tMessage)); } return(Read( _streamNameBuilder.GenerateForEventType(tMessage.Name), checkpoint, count, readBackwards)); }