To get the global service manager, use:
service_manager = pdg.ServiceManager.get()
Methods
Static Methods
get()
→ pdg.ServiceManager
Static method
Returns the global service manager instance.
saveRegisteredServices()
Static method
Saves all registered services and their configurations to the user’s preference folder.
Instance Methods
getService(name)
→ pdg.Service
Returns a registered service with the specified name
.
registerService(name, pool_size, scheduler_type, port, auto_start, client_logging_dir)
→ pdg.Service
Registers a service. The name
must be the name of a valid
pdg.ServiceType. The pool_size
specifies how many client instances
will be used when the service is started. The scheduler_type
argument
specifies a pdg.SchedulerType that this registered service will be
associated with. The scheduler_type
passed to this method must provide
support for PDG services. The port
specifies the port number. If 0 is
specified as the port number, the port will be automatically determined.
The auto_start
argument specifies whether the service should automatically
start. The client_logging_dir
argument specifies the directory where
logfiles will be written by client instances.
If the registration succeeds, this method will return the pdg.Service instance.
deregisterService(name)
Removes a service from the PDG service manager’s registry. name
must be
the name of a valid service.
registerSessionService(name, pool_size, port, auto_start, client_logging_dir, mqserver_log_level=0, mqserver_log_dir="$HOUDINI_TEMP_DIR")
→ pdg.Service
Registers a session service. The name
must be the name of a valid
pdg.ServiceType. The pool_size
specifies how many client instances
will be used when the service is started. The port
specifies the port
number. If 0 is specified as the port number, the port will be automatically
determined. The auto_start
argument specifies whether the service should
automatically start. The client_logging_dir
argument specifies the
directory where logfiles will be written by client instances.
mqserver_log_level
specifies the log level of the MQ server process
(0 = None, 1 = Errors, 2 = Warnings, 3 = All). The log level is 0 by
default. mqserver_log_dir
specifies the directory where the log file will
be written to by the MQ server process. By default, the log file will be
written to the Houdini temp directory.
If the registration succeeds, this method will return the pdg.Service instance.
startService(name)
→ bool
Starts a PDG service. Returns True
for success and False
for failure.
stopService(name)
→ bool
Stops a running PDG service. Returns True
for success and False
for
failure.
registeredServiceNames()
→ list
of str
Returns a list
of the names of all services that are registered with the
PDG service manager.
getSchedulerType(name)
→ pdg.SchedulerType
Returns the pdg.SchedulerType associated with a registered service.
hasServiceSupport(scheduler_type)
→ bool
Checks whether the pdg.SchedulerType specified by the scheduler_type
argument supports running PDG services.
addEventHandler(handler, filter:
pdg.EventType, pass_handler=False)
→ pdg.EventHandler
Adds an event handler to the service manager, with a list of the types of events to receive. The handler
should be a callable that accepts one argument of type pdg.Event.
If pass_handler
is True, the handler itself is passed as the first argument to the function, otherwise only the event object is passed to the function.
removeEventHandler(handler)
Removes an event handler from the service manager.