Inheritance |
|
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(type_name, service_name, pool_size, port, auto_start, client_logging_dir, mqserver_log_level=0, mqserver_log_dir="$HOUDINI_TEMP_DIR", connection_timeout=5000, client_logging_type=
pdg.serviceClientLogType.File, persistent=True)
→ pdg.Service
Registers a service. The type_name
must be the name of a valid
pdg.ServiceType. The service_name
should be a human readable name
for the service. 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(type_name, service_name, pool_size, port, auto_start, client_logging_dir, mqserver_log_level=0, mqserver_log_dir="$HOUDINI_TEMP_DIR", connection_timeout=5000, client_logging_type=
pdg.serviceClientLogType.File, persistent=True)
→ pdg.Service
Registers a session service. The type_name
must be the name of a valid
pdg.ServiceType. The service_name
should be a human readable name
for the service. 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, ignore_stopped=False)
→ bool
Stops a running PDG service. Returns True
for success and False
for
failure. If ignore_stopped
is True
, then the method succeeds even if
the service is already stopped or is currently stopping. Otherwise,
this method will fail when called on a service that isn’t currently
running.
resetClient(service_name, client_name="")
→ bool
Resets a running service. The actions performed by a reset are defined by
the service type. Returns True
for success and False
for failure. If
client_name
is specified, then only the client from the service with that
name is reset.
restartClient(service_name, client_name="")
→ bool
Restarts a sevice client, or all service clients if client_name
is not
specified. Returns True
for success, and False
for failure.
stopClient(service_name, client_name="")
→ bool
Stops a sevice client, or all service clients if client_name
is not
specified. Returns True
for success, and False
for failure.
resetService(service_name, client_name="")
→ bool
This method is deprecated. Use pdg.ServiceManager.resetClient instead.
registeredServiceNames()
→ list
of str
Returns a list
of the names of all services that are registered with the
PDG service manager.
hasServiceSupport(scheduler_type)
→ bool
Checks whether the pdg.SchedulerType specified by the scheduler_type
argument supports running PDG services.
Methods from pdg.EventEmitter ¶
addEventHandler(handler, filter=pdg.EventType.All, pass_handler=False)
→ pdg.PyEventHandler
Adds an event handler to the emitter, with a value of the type of event 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.
hasEventHandler(handler)
→ bool
Returns True
if the event emitter already has an event handler that uses the handler
function or callback object.
removeEventHandler(handler)
Removes an event handler from the emitter.
removeAllEventHandlers()
Removes all event handlers from the emitter.
eventHandlers
→ list
of pdg.EventHandler
Property
Returns the list of all active event handles for the emitter.
supportedEventTypes
→ list
of `pdg.EventType
Property
The list of event types that this event emitter may produce when PDG is cooking