Emesary: Difference between revisions

Jump to navigation Jump to search
482 bytes added ,  12 May 2016
Line 68: Line 68:


<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
var HelloRecipient =
{
    new: func(_ident)
    {
        var new_class = emesary.Recipient.new(_ident);
        new_class.count = 0;
        new_class.Receive = func(notification)
        {
            if (notification.Type == "Hello")
            {
                me.count = me.count + 1;
                return emesary.Transmitter.ReceiptStatus_OK;
            }
            return emesary.Transmitter.ReceiptStatus_NotProcessed;
        };
        return new_class;
    },
};
</syntaxhighlight>
</syntaxhighlight>


Navigation menu