blpapi.ServiceRegistrationOptions¶
- class blpapi.ServiceRegistrationOptions¶
Contains the options which can be specified when registering a service.
To use non-default options to
registerService(), create aServiceRegistrationOptionsinstance and set the required options and then supply it when using theregisterService()interface.The following attributes represent service registration priorities:
The following attributes represent the registration parts:
- PART_DEFAULT = 1¶
Register the parts of the service implied by options specified in the service metadata
- PART_OPERATIONS = 4¶
Register to receive the request types corresponding to each “operation” defined in the service metadata
- PART_PUBLISHER_RESOLUTION = 16¶
Register to receive resolution requests (with message type
PermissionRequest) from publishers (viaProviderSession.createTopics())
- PART_PUBLISHING = 2¶
Register to receive subscribe and unsubscribe messages
- PART_SUBSCRIBER_RESOLUTION = 8¶
Register to receive resolution requests (with message type
PermissionRequest) from subscribers
- PRIORITY_HIGH = 2147483647¶
- PRIORITY_LOW = 0¶
- PRIORITY_MEDIUM = 1073741823¶
- __init__()¶
Create
ServiceRegistrationOptionswith default options.
- addActiveSubServiceCodeRange(begin, end, priority)¶
- Parameters
Advertise the service to be registered to receive, with the specified
priority, subscriptions that the resolver has mapped to a service code between the specifiedbeginand the specifiedendvalues, inclusive. Numerically greater values ofpriorityindicate higher priorities.Note
The behavior of this function is undefined unless
0 <= begin <= end < (1 << 24), andpriorityis non-negative.
- destroy()¶
Destroy the handle using stored dtor
- getPartsToRegister()¶
- Returns
The parts of the service to be registered.
- Return type
Registration parts are enumerated in the class docstring.
- getServicePriority()¶
- Returns
- The value of the priority for subscription services in this
instance.
- Return type
- removeAllActiveSubServiceCodeRanges()¶
Remove all previously added sub-service code ranges.
- setGroupId(groupId)¶
Set the Group ID for the service to be registered.
- Parameters
groupId (str) – The group ID for the service to be registered
Set the Group ID for the service to be registered to the specified
groupIdstring. IfgroupIdlength is greater thanMAX_GROUP_ID_SIZE(=64) only the firstMAX_GROUP_ID_SIZEchars are considered as Group Id.
- setPartsToRegister(parts)¶
Set the parts of the service to be registered.
- Parameters
int – Parts of the service to be registered.
Set the parts of the service to be registered to the specified
parts, which must be a bitwise-or of the options provided in “registration parts” options (enumerated in the class docstring). This option defaults toPART_DEFAULT.
- setServicePriority(priority)¶
Set the priority with which a subscription service will be registered.
- Parameters
priority (int) – The service priority
Set the priority with which a subscription service will be registered to the specified
priority, where numerically greater values ofpriorityindicate higher priorities. The behavior is undefined unlesspriorityis non-negative. Note that while the values pre-defined inServiceRegistrationOptionsare suitable for use here, any non-negativepriorityis acceptable.By default, a service will be registered with priority
PRIORITY_HIGH.Note this has no effect for request-response or resolution services.