blpapi.TopicList¶
-
class
blpapi.TopicList¶ 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 onoriginal.- Parameters
original (TopicList) – Original topiclist to copy off of
If
originalisNone- create emptyTopicList. Otherwise create aTopicListfromoriginal.
-
add(topicOrMessage, correlationId=None)¶ Add the specified topic or topic from message to this
TopicList.- Parameters
topicOrMessage (str or Message) – Topic string or message to create a topic from
correlationId (CorrelationId) – CorrelationId to associate with the topic
- Returns
0on success or negative number on failure.- Return type
- 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
- Returns
Message received during creation of the topic identified by the specified
correlationId.- Return type
- Raises
Exception – If
correlationIddoes not identify an entry in thisTopicListor if the status of the entry identified bycorrelationIdis notCREATED.
The message returned can be used when creating an instance of
Topic.
-
messageAt(index)¶ - Parameters
index (int) – Index of the entry
- Returns
- Message received during creation of the entry at
index.
- Return type
- Raises
Exception – If
index >= size()or if the status of the entry identify bycorrelationIdis notCREATED.
The message returned can be used when creating an instance of
Topic.
-
status(correlationId)¶ - Parameters
correlationId (CorrelationId) – Correlation id associated with the entry
- Returns
Status of the entry in this list identified by the specified
correlationId. This may beNOT_CREATED,CREATEDandFAILURE.- Return type
- 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.
- Returns
Topic of the entry identified by ‘correlationId’.
- Return type
- Raises
Exception – If the
correlationIddoes not identify an entry in this list.
-