SharedMemory#

class streaming.base.shared.SharedMemory(name=None, create=None, size=0, auto_cleanup=True)[source]#

Improved quiet implementation of shared memory.

Parameters
  • name (str, optional) – A unique shared memory block name. Defaults to None.

  • create (bool, optional) – Creates a new shared memory block or attaches to an existing shared memory block. Defaults to None.

  • size (int, optional) – A size of a shared memory block. Defaults to 0.

  • auto_cleanup (bool, optional) – Register atexit handler for cleanup or not. Defaults to True.

property buf#

Internal buffer accessor.

Returns

memoryview – Internal buffer.

cleanup()[source]#

Clean up SharedMemory resources.

fix_register(name, rtype)[source]#

Skip registering resource tracking for shared memory.

Parameters
  • name (str) – Name of a shared memory

  • rtype (str) – Name of a resource type

Returns

Any – resource tracker or None

fix_unregister(name, rtype)[source]#

Skip un-registering resource tracking for shared memory.

Parameters
  • name (str) – Name of a shared memory

  • rtype (str) – Name of a resource type

Returns

Any – resource tracker or None