Package | com.pushtechnology.diffusion |
Class | public class TopicListener |
Inheritance | TopicListener ![]() |
Topic message listeners are constructed by the Diffusion client, using the DiffusionClient#addTopicListener(RegExp,Function,Object) method.
They are a tuple of the topic name pattern, a pointer to the callback function, the callback context and the topic handle. The topic handle is a number assigned by the Diffusion client. The topic name pattern is a regular expression used to match topic names of messages, if a message's topic name matches the pattern the callback will be made. The callback function pointer is used to make the callback, the context is optional and will be passed to the function pointer when it is called. The function pointer should accept a single TopicMessage object.
Method | Defined By | ||
---|---|---|---|
TopicListener(pattern:RegExp, fp:Function, handle:int, thisContext:Object) | TopicListener | ||
getFunction():Function
Get the callback function pointer for the topic listener. | TopicListener | ||
getHandle():int
Get the handle for the topic listener. | TopicListener | ||
getRegex():RegExp
Get the regular expression for the topic listener. | TopicListener | ||
getThisContext():Object
Get the callback context for the topic listener. | TopicListener |
TopicListener | () | Constructor |
public function TopicListener(pattern:RegExp, fp:Function, handle:int, thisContext:Object)
pattern:RegExp | |
fp:Function | |
handle:int | |
thisContext:Object |
getFunction | () | method |
public function getFunction():Function
Get the callback function pointer for the topic listener.
ReturnsFunction |
getHandle | () | method |
public function getHandle():int
Get the handle for the topic listener.
Returnsint |
getRegex | () | method |
public function getRegex():RegExp
Get the regular expression for the topic listener.
ReturnsRegExp |
getThisContext | () | method |
public function getThisContext():Object
Get the callback context for the topic listener.
ReturnsObject |