asynchronous send on Bus
This commit is contained in:
parent
d095a9880d
commit
cdd87cd99a
15
src/bus.js
15
src/bus.js
|
@ -30,6 +30,8 @@ Bus.Connector.prototype.register = function(name, fn, thisValue)
|
|||
};
|
||||
|
||||
/**
|
||||
* Send ("emit") a message
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {Object=} value
|
||||
*/
|
||||
|
@ -56,6 +58,19 @@ Bus.Connector.prototype.send = function(name, value)
|
|||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Send a message, guaranteeing that it is received asynchronously
|
||||
*
|
||||
* @param {string} name
|
||||
* @param {Object=} value
|
||||
*/
|
||||
Bus.Connector.prototype.send_async = function(name, value)
|
||||
{
|
||||
dbg_assert(arguments.length === 1 || arguments.length === 2);
|
||||
|
||||
setTimeout(this.send.bind(this, name, value), 0);
|
||||
};
|
||||
|
||||
|
||||
Bus.create = function()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue