Source/NFX.Erlang/Connect/ErlMbox.cs
/// <summary>
/// Receive a message and match it against a given pattern
/// </summary>
/// <param name="pm">Patterns to match the message against</param>
/// <param name="timeoutMsec">Timeout in milliseconds</param>
/// <returns>Return a tuple containing the received message and index of the
/// pattern in the pm instance that was successfully matched.
/// On timeout the 2nd element of the tuple is -2 and 1st element of the tuple is null.
/// On unsuccessful match the second element of the tuple is -1</returns>
Receive a message and match it against a given pattern
Receive a message and match it against a given pattern
public Tuple<IErlObject, int> ReceiveMatch(ErlPatternMatcher pm, int timeoutMsec = -1)
    {
      var m = Receive(timeoutMsec);
      if (m == null) return Tuple.Create<IErlObject, int>(null, -2);
      int n = pm.Match(ref m);
      return Tuple.Create(m, n);
    }
public Tuple < IErlObject , int > ReceiveMatch ( ErlPatternMatcher pm , int timeoutMsec = - 1 ) { var m = Receive ( timeoutMsec ) ; if ( m == null ) return Tuple . Create < IErlObject , int > ( null , - 2 ) ; int n = pm . Match ( ref m ) ; return Tuple . Create ( m , n ) ; }
Receive a message and match it against a given pattern
Receive a message and match it against a given pattern
Return a tuple containing the received message and index of the
pattern in the pm instance that was successfully matched.
On timeout the 2nd element of the tuple is -2 and 1st element of the tuple is null.
On unsuccessful match the second element of the tuple is -1
Return a tuple containing the received message and index of the pattern in the pm instance that was successfully matched . On timeout the 2nd element of the tuple is - 2 and 1st element of the tuple is null . On unsuccessful match the second element of the tuple is - 1
pm
ErlPatternMatcher
Patterns to match the message against
Patterns to match the message against
timeoutMsec
int
Timeout in milliseconds
Timeout in milliseconds