Source/NFX/DataAccess/CRUD/Subscriptions/Mailbox.cs
/// <summary>
/// Tries to take the specified number of samples in chronological order
/// </summary>
Tries to take the specified number of samples in chronological order
Tries to take the specified number of samples in chronological order
public List<CRUDSubscriptionEvent> FetchBuffered(int count, bool keep = false)
      {
       var result = new List<CRUDSubscriptionEvent>();
       if (count<=0) return result;
       lock(m_Buffer)
        for(var i=0; i<count; i++)
        {
          var first = m_Buffer.First;
          if (first==null) break;
          result.Add(first.Value);
          if (keep) continue;
          m_Buffer.RemoveFirst();
        }
        return result;
      }
public List < CRUDSubscriptionEvent > FetchBuffered ( int count , bool keep = false ) { var result = new List < CRUDSubscriptionEvent > ( ) ; if ( count <= 0 ) return result ; lock ( m_Buffer ) for ( var i = 0 ; i < count ; i ++ ) { var first = m_Buffer . First ; if ( first == null ) break ; result . Add ( first . Value ) ; if ( keep ) continue ; m_Buffer . RemoveFirst ( ) ; } return result ; }
Tries to take the specified number of samples in chronological order
Tries to take the specified number of samples in chronological order
count
int
keep
bool