Source/NFX.Erlang/Connect/ErlMbox.cs
/// <summary>
/// Receive a message and match it against a given pattern
/// </summary>
/// <param name="pattern">Pattern to match the message against</param>
/// <param name="timeoutMsec">Timeout in milliseconds</param>
/// <returns>Return a tuple containing the received message and variable
/// binding object. On timeout the first element of the tuple is null.
/// On unsuccessful match the second element of the tuple is null</returns>
Receive a message and match it against a given pattern
Receive a message and match it against a given pattern
public Tuple<IErlObject, ErlVarBind> ReceiveMatch(IErlObject pattern, int timeoutMsec = -1)
    {
      var m = Receive(timeoutMsec);
      if (m == null) return Tuple.Create<IErlObject, ErlVarBind>(null, null);
      var binding = new ErlVarBind();
      bool res = m.Match(pattern, binding);
      return Tuple.Create(m, res ? binding : null);
    }
public Tuple < IErlObject , ErlVarBind > ReceiveMatch ( IErlObject pattern , int timeoutMsec = - 1 ) { var m = Receive ( timeoutMsec ) ; if ( m == null ) return Tuple . Create < IErlObject , ErlVarBind > ( null , null ) ; var binding = new ErlVarBind ( ) ; bool res = m . Match ( pattern , binding ) ; return Tuple . Create ( m , res ? binding : null ) ; }
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 variable
binding object. On timeout the first element of the tuple is null.
On unsuccessful match the second element of the tuple is null
Return a tuple containing the received message and variable binding object . On timeout the first element of the tuple is null . On unsuccessful match the second element of the tuple is null
pattern
IErlObject
Pattern to match the message against
Pattern to match the message against
timeoutMsec
int
Timeout in milliseconds
Timeout in milliseconds