diffusion
Version:
Diffusion JavaScript client
28 lines (26 loc) • 822 B
JavaScript
/**
* Service implementation to provide Ping functionality.
* <P>
* Intended to provide basic Ping functionality by immediately responding to a
* received request, by which the round-trip latency between the sender and
* receiver may be ascertained.
* <P>
* This implementation is monitored. It notifies the session activity monitor
* of the ping.
*
* @module services/MonitoredPing
*/
var service = {
/**
* Handle an inbound request.
*
* @param {InternalSession} internal - The internal session instance
* @param {Object} [ping=null] - The inbound ping request
* @param {Function} callback - The service reference callback
*/
onRequest : function(internal, ping, callback) {
callback.respond();
internal.onSystemPing();
}
};
module.exports = service;