Methods ¶
Instance Methods ¶
addClients()
→ pdg.ServiceAddClientBlock
Opens a context manager that waits for any pending clients to connect.
addPendingClient(server_addr, server_port, client_index)
→ pdg.ServiceClientInfo
Adds a client that’s pending connection, and returns its client info. This
method should be called in a with
statement using pdg.Service.addClients.
client(client_name)
→ pdg.ServiceClientInfo
Return the client info given the name of the client.
schedulerContextName()
→ str
Returns the name of the graph context of the scheduler associated with the service.
schedulerName()
→ str
Returns the name of the scheduler associated with the service.
setScheduler(name, context_name)
Stores the name of the scheduler instance and its graph context associated with the service, which is used to stop and start the service.
getCommand(server_address, server_port, client_num)
→ str
Returns a service client’s command string, which can be used by the caller to start the client process. It is the responsibility of the caller to expand any environment variables or PDG tokens in the command string.
getCommandArgs(server_address, server_port, client_num)
→ list
Returns a service client’s command as a list of arguments, which can be used by the caller to start the client process. It is the responsibility of the caller to expand any environment variables or PDG tokens in the argument list.
getPollingClient()
: PDGNPollingClient
Returns the polling client for this service’s MQ server, if applicable. Returns None if there is none; for example, when the service is idle.
getServiceClientName(client_num)
→ str
This method returns the name of the client with the provided client number.
The client number is zero-indexed and must be between 0 and pool_size
- 1,
inclusive.
stop(stop_mq_server, wait_for_clients)
→ bool
Stops the service. When stop_mq_server
is False
, this method will not
stop the MQ server. When wait_for_clients
is True
, this method will not
return until all of the clients have shutdown and disconnected from the MQ
server. Returns True
for success and False
for failure.
startReadyListener()
This method is deprecated, and should be replaced with the pdg.Service.addClients context manager.
incrementStartingClientsCount()
This method is deprecated, and should be replaced with a class to
pdg.Service.addPendingClient inside of a with
statement using the
pdg.Service.addClients context manager.
stopReadyListener()
This method is deprecated, and should be replaced with the pdg.Service.addClients context manager.
waitForClients()
This method is deprecated, and should be replaced with the pdg.Service.addClients context manager.
clearScheduler()
When the service is a scheduler service, this method will clear the scheduler associated wtih the service. The scheduler must be set again before the service can be started.
auto_start
: bool
Property
This property is deprecated. Use pdg.Service.isAutoStart instead.
clients
: list
of str
Property
The list of client names that have been added to the service.
client_logging_dir
: str
Property
This property is deprecated. Use pdg.Service.clientLogDir instead.
clientLogDir
: str
Property
The directory where logfiles will be written by client instances.
clientLogType
: pdg.serviceClientLogType
Property
The log type used by client instances.
command
: str
Property
The command line arguments that the PDG service manager will use to start client instances of the service.
connectionTimeout
: str
Property
Stores the connection timeout used by the service. The timeout is used for all connections between service clients, the MQ server, and Houdini.
data
: object
Property
An object
containing information that the pdg.SchedulerType
associated with the registered service needs to start and stop the service.
envVarNames
: list
of str'
Property
The names of the environment variables to be added to the environment for this service’s processes.
envVarValues
: list
of str
Property
The values of the environment variables to be added to the environment for this service’s processes.
extraArguments
: list
of str
Property
The list of extra arguments to append to the end of the service job’s command line
isAutoStart
: bool
Property
Indicates if the service should be automatically started on the first PDG graph cook where the service is used (if the service is not already running).
isInternal
: bool
Property
Indicates whether the service is internal to PDG. Internal services are not available for the user to configure.
isPersistent
: bool
Property
Indicates whether or not the service is saved to the pdgservices.json
file when the pdg.ServiceManager saves service definitions to disk.
memoryLimit
: `int
Property
The memory limit for service clients. When this limit is reached, the client
is reset using the operation defined by the memoryResetType
property.
memoryResetType
: pdg.serviceResetType
Property
The type of reset operation to perform a when service client exceeds the memory limit.
mqLogDir
: str
Property
The directory where the log of the MQ server created for the service will be written to.
mqLogLevel
: int
Property
The logging level of the MQ server that is created for the service.
(0 = None, 1 = Errors, 2 = Warnings, 3 = All)
mqserver_log_dir
: str
Property
This property is deprecated. Use pdg.Service.mqLogDir instead.
mqserver_log_level
: int
Property
This property is deprecated. Use pdg.Service.mqLogLevel instead.
mqPort
: int
Property
Stores the port that the MQ server associated with the service is using.
mqUrl
: str
Property
Stores the URL of the MQ server that the service is using.
name
: str
Property
The name of the service.
owner
: pdg.serviceOwner
Property
Indicates whether the service is owned by a scheduler node or the Houdini session.
poolSize
: int
Property
The number of clients available in the service pool.
pool_size
: int
Property
This property is deprecated. Use pdg.Service.poolSize instead.
port
: int
Property
The port that the service will use.
state
: pdg.serviceState
Property
Indicates the state of the service (stopped, starting, running).