Source/NFX.Erlang/Internal/MboxRegistry.cs
/// <summary>
/// Return a new or unused mailbox from freelist
/// </summary>
Return a new or unused mailbox from freelist
Return a new or unused mailbox from freelist
public ErlMbox Create(bool useCache = true)
    {
      ErlMbox m = null;
      ErlPid  pid = ErlPid.Null;
      if (useCache && m_Node.MboxFreelist.TryPeek(out m) &&
          (DateTime.UtcNow - m.LastUsed).TotalSeconds > 60)
        while (m_Node.MboxFreelist.TryDequeue(out m))
        {
          if (m.Disposed || m.DisposeStarted)
            continue;
          pid = m.Self;
          break;
        }
      if (pid == ErlPid.Null)
      {
        pid = m_Node.CreatePid();
        m   = new ErlMbox(m_Node, pid);
      }
      m_ByPid[pid] = m;
      return m;
    }
public ErlMbox Create ( bool useCache = true ) { ErlMbox m = null ; ErlPid pid = ErlPid . Null ; if ( useCache && m_Node . MboxFreelist . TryPeek ( out m ) && ( DateTime . UtcNow - m . LastUsed ) . TotalSeconds > 60 ) while ( m_Node . MboxFreelist . TryDequeue ( out m ) ) { if ( m . Disposed || m . DisposeStarted ) continue ; pid = m . Self ; break ; } if ( pid == ErlPid . Null ) { pid = m_Node . CreatePid ( ) ; m = new ErlMbox ( m_Node , pid ) ; } m_ByPid [ pid ] = m ; return m ; }
Return a new or unused mailbox from freelist
Return a new or unused mailbox from freelist
useCache
bool