Beispiel #1
0
        /// <summary>
        /// Get the current value.
        /// </summary>
        /// <param name="exception"></param>
        /// <returns>
        /// Returns the current batch container.
        /// If null then the stream has completed or there was a stream error.
        /// If there was a stream error, an error exception will be provided in the output.
        /// </returns>
        public virtual IBatchContainer GetCurrent(out Exception exception)
        {
            SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor.GetCurrent: {Current}", current);

            exception = null;
            return(current);
        }
 /// <summary>
 /// Cursor into a simple queue cache
 /// </summary>
 /// <param name="cache"></param>
 /// <param name="streamIdentity"></param>
 /// <param name="logger"></param>
 public SimpleQueueCacheCursor(SimpleQueueCache cache, IStreamIdentity streamIdentity, Logger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException("cache");
     }
     this.cache = cache;
     this.streamIdentity = streamIdentity;
     this.logger = logger;
     current = null;
     SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor New Cursor for {0}, {1}", streamIdentity.Guid, streamIdentity.Namespace);
 }
Beispiel #3
0
 /// <summary>
 /// Cursor into a simple queue cache
 /// </summary>
 /// <param name="cache"></param>
 /// <param name="streamIdentity"></param>
 /// <param name="logger"></param>
 public SimpleQueueCacheCursor(SimpleQueueCache cache, IStreamIdentity streamIdentity, ILogger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException(nameof(cache));
     }
     this.cache          = cache;
     this.streamIdentity = streamIdentity;
     this.logger         = logger;
     current             = null;
     SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor New Cursor for {Guid}, {NameSpace}", streamIdentity.Guid, streamIdentity.Namespace);
 }
Beispiel #4
0
 /// <summary>
 /// Cursor into a simple queue cache
 /// </summary>
 /// <param name="cache"></param>
 /// <param name="streamId"></param>
 /// <param name="logger"></param>
 public SimpleQueueCacheCursor(SimpleQueueCache cache, StreamId streamId, ILogger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException(nameof(cache));
     }
     this.cache    = cache;
     this.streamId = streamId;
     this.logger   = logger;
     current       = null;
     SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor New Cursor for {StreamId}, {NameSpace}", streamId);
 }
 public SimpleQueueCacheCursor(SimpleQueueCache cache, Guid streamGuid, string streamNamespace, Logger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException("cache");
     }
     this.cache           = cache;
     this.streamGuid      = streamGuid;
     this.streamNamespace = streamNamespace;
     this.logger          = logger;
     current = null;
     SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor New Cursor for {0}, {1}", streamGuid, streamNamespace);
 }
 public SimpleQueueCacheCursor(SimpleQueueCache cache, Guid streamGuid, string streamNamespace, Logger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException("cache");
     }
     this.cache = cache;
     this.streamGuid = streamGuid;
     this.streamNamespace = streamNamespace;
     this.logger = logger;
     current = null;
     SimpleQueueCache.Log(logger, "SimpleQueueCacheCursor New Cursor for {0}, {1}", streamGuid, streamNamespace);
 }
 /// <summary>
 /// Cursor into a simple queue cache
 /// </summary>
 /// <param name="cache"></param>
 /// <param name="streamId"></param>
 /// <param name="logger"></param>
 public SimpleQueueCacheCursor(SimpleQueueCache cache, StreamId streamId, ILogger logger)
 {
     if (cache == null)
     {
         throw new ArgumentNullException(nameof(cache));
     }
     this.cache    = cache;
     this.streamId = streamId;
     this.logger   = logger;
     current       = null;
     if (logger.IsEnabled(LogLevel.Debug))
     {
         logger.LogDebug("SimpleQueueCacheCursor New Cursor for {StreamId}", streamId);
     }
 }