20,741
edits
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> | ||