public Push Receive(Reply.Status status, Action <Reply> callback) { if (reply.HasValue && reply.Value.status == status) { callback(reply.Value); } replyHooks[status] = callback; return(this); }
public static string AsString(this Reply.Status status) { switch (status) { case Reply.Status.Ok: return("ok"); case Reply.Status.Error: return("error"); case Reply.Status.Timeout: return("timeout"); default: throw new ArgumentOutOfRangeException("unexpected value"); } }