syncDict#

swordfish.function.syncDict()#

Return a thread-safe dictionary that allows concurrent read and write by multiple threads.

Parameters:
  • keyType (Union[Alias[Literal["keyObj"]], Constant]) – The data type of dictionary keys. The following data categories are supported: Integral (excluding COMPRESSED), Temporal, Floating and Literal.

  • valueType (Union[Alias[Literal["valueObj"]], Constant]) – The data type of dictionary values. Note that COMPLEX/POINT is not supported.

  • sharedName (Constant, optional) – A a string, by default DFLT. If it is specified, the dictionary is shared across sessions.

  • ordered (Constant, optional) – A Boolean value, by default DFLT. The default value is false, which indicates to create a regular dictionary. True means to create an ordered dictionary. The regular dictionaries do not track the insertion order of the key-value p airs whereas the ordered dictionaries preserve the insertion order of key-value pairs.