/// <summary>
 /// Create a default persistent queue session.
 /// <para>You should use <see cref="IPersistentQueue.OpenSession"/> to get a session.</para>
 /// <example>using (var q = PersistentQueue.WaitFor("myQueue")) using (var session = q.OpenSession()) { ... }</example>
 /// </summary>
 public PersistentQueueSession(IPersistentQueueImpl queue, Stream currentStream, int writeBufferSize)
 {
     lock (_ctorLock)
     {
         this.queue = queue;
         this.currentStream = currentStream;
         if (writeBufferSize < MinSizeThatMakeAsyncWritePractical)
             writeBufferSize = MinSizeThatMakeAsyncWritePractical;
         this.writeBufferSize = writeBufferSize;
         disposed = false;
     }
 }
Example #2
0
 /// <summary>
 /// Create a default persistent queue session.
 /// <para>You should use <see cref="IPersistentQueue.OpenSession"/> to get a session.</para>
 /// <example>using (var q = PersistentQueue.WaitFor("myQueue")) using (var session = q.OpenSession()) { ... }</example>
 /// </summary>
 public PersistentQueueSession(IPersistentQueueImpl queue, Stream currentStream, int writeBufferSize)
 {
     lock (_ctorLock)
     {
         this.queue         = queue;
         this.currentStream = currentStream;
         if (writeBufferSize < MinSizeThatMakeAsyncWritePractical)
         {
             writeBufferSize = MinSizeThatMakeAsyncWritePractical;
         }
         this.writeBufferSize = writeBufferSize;
         disposed             = false;
     }
 }