blpapi.CorrelationId¶
-
class
blpapi.CorrelationId¶ A key used to identify individual subscriptions or requests.
Two
CorrelationIdobjects are considered equal if they have the sametype()and:Hold the same (not just equal!) objects, if the type is
OBJECT_TYPE.Hold equal integers, if the type is
INT_TYPEorAUTOGEN_TYPE.
If the type is
UNSET_TYPE, then the twoCorrelationIdobjects are always equal (as the value of both will necessarily beNone).It is possible that a user constructed
CorrelationIdand aCorrelationIdgenerated by the API could return the same result forvalue(). However, they will not compare equal because they have a differenttype().CorrelationIdobjects are passed to many of theSessionobject methods which initiate asynchronous operations and are obtained fromMessageobjects which are delivered as a result of those asynchronous operations.When subscribing or requesting information, an application has the choice of providing a
CorrelationIdthey construct themselves or allowing the session to construct one for them. If the application supplies aCorrelationId, it must not re-use the value contained in it in anotherCorrelationId, whilst the original request or subscription is still active.The
xxx_TYPEclass attributes represent the possible types ofCorrelationId.-
AUTOGEN_TYPE= 3¶ The
CorrelationIdwas created internally by API.
-
INT_TYPE= 1¶ The
CorrelationIdwas created from anintorlongsupplied by the user.
-
MAX_CLASS_ID= 65535¶ The maximum value allowed for
classId.
-
OBJECT_TYPE= 2¶ The
CorrelationIdwas created from an object supplied by the user.
-
UNSET_TYPE= 0¶ The
CorrelationIdis unset. That is, it was created by the defaultCorrelationIdconstructor.
-
__init__(*args)¶ CorrelationId([value[, classId=0]])constructs aCorrelationIdobject.If
valueis an integer (eitherintorlong) then the createdCorrelationIdwill have typeINT_TYPE. Otherwise, it will have typeOBJECT_TYPE.If no arguments are specified, then the type will be
UNSET_TYPE.The maximum allowed
classIdvalue isMAX_CLASS_ID.
-
classId()¶ - Returns
The user defined classification of this
CorrelationIdobject- Return type
-
type()¶ - Returns
The type of this CorrelationId object (see the
xxx_TYPEclass attributes)- Return type
-
value()¶ -
The return value depends on this
CorrelationId’s value type and could be:Integer (
type() == CorrelationId.INT_TYPEortype() == CorrelationId.AUTOGEN_TYPE)Object (
type() == CorrelationId.OBJECT_TYPE)None(type() == CorrelationId.UNSET_TYPE)