createPublisher(server,
port,
user='',
password='',
idle_timeout=IDLE_TIMEOUT,
exit_timeout=EXIT_TIMEOUT)
| source code
|
Create a new publisher thread which extends GangaThread where available
(i.e. on the client) or Thread otherwise (i.e. on the worker node).
N.B. If GangaThread is not available then an exit handler is added, with the
given timeout.
@param server: The server host name.
@param user: The user name.
@param password: The password.
@param logger: The logger instance.
@param idle_timeout: Maximum seconds to idle before closing connection.
Negative value indicates never close connection.
@param exit_timeout: Maximum seconds to clear message queue on exit.
Negative value indicates clear queue without timeout.
Usage::
from Ganga.Lib.MonitoringServices.MSG import MSGUtil
p = MSGUTIL.createPublisher('ganga.msg.cern.ch', 6163)
p.start()
p.send('/topic/ganga.dashboard.test', 'Hello World!')
See also stomputil.publisher
|