blpapi.TopicList
- class blpapi.TopicList(original=None)
A list of topics which require creation.
Contains a list of topics which require creation.
Created from topic strings or from
TOPIC_SUBSCRIBEDorRESOLUTION_SUCCESSmessages. This is passed to acreateTopics()call orcreateTopicsAsync()call on aProviderSession. It is updated and returned by thecreateTopics()call.- CREATED = 1
- FAILURE = 2
- NOT_CREATED = 0
- __init__(original=None)
Create an empty
TopicList, or aTopicListbased onoriginalResolutionList.- Parameters
original – Original resolution list to use.
- Raises
TypeError – If
originalis not an instance ofResolutionList.
If
originalisNone- create emptyTopicList. Otherwise create aTopicListfromoriginal. In this caseoriginalis used by handle, so if the caller modifies original resolution list after the call,TopicListalso changes because owns the same handle.
- add(topicOrMessage, correlationId=None)
Add the specified topic or topic from message to this
TopicList.- Parameters
topicOrMessage (
Union[str,Message]) – Topic string or message to create a topic fromcorrelationId (
Optional[CorrelationId]) – CorrelationId to associate with the topic
- Return type
- Returns
0on success or negative number on failure.- Raises
TypeError – If
correlationIdis not an instance ofCorrelationId.
If topic is passed as
topicOrMessage, add the topic to this list, optionally specifying acorrelationId. After a successful call toadd()the status for this entry isNOT_CREATED.If
Messageis passed astopicOrMessage, add the topic contained in the specifiedtopicSubscribedMessageorresolutionSuccessMessageto this list, optionally specifying acorrelationId. After a successful call toadd()the status for this entry isNOT_CREATED.
- correlationIdAt(index)
- message(correlationId)
- Parameters
correlationId (
CorrelationId) – Correlation id associated with the message- Return type
- Returns
Message received during creation of the topic identified by the specified
correlationId.- Raises
Exception – If
correlationIddoes not identify an entry in thisTopicList.
The message returned can be used when creating an instance of
Topic.
- messageAt(index)
- Parameters
index (
int) – Index of the entry- Return type
- Returns
- Message received during creation of the entry at
index.
- Raises
Exception – If
index >= size().
The message returned can be used when creating an instance of
Topic.
- status(correlationId)
- Parameters
correlationId (
CorrelationId) – Correlation id associated with the entry- Return type
- Returns
Status of the entry in this list identified by the specified
correlationId. This may beNOT_CREATED,CREATEDandFAILURE.- Raises
Exception – If the
correlationIddoes not identify an entry in this list.
- statusAt(index)
- topicString(correlationId)
- Parameters
correlationId (
CorrelationId) – Correlation id associated with the topic.- Return type
- Returns
Topic of the entry identified by ‘correlationId’.
- Raises
Exception – If the
correlationIddoes not identify an entry in this list.