Skip to main content

Shared list / set / dict across processes / environments

Project description

Shared list / set / dict across processes / environments

pip install sharedbuiltinmutables

Tested against Windows 10 / Python 3.11 / Anaconda

FILE 1

from sharedbuiltinmutables import MemSharedDict, MemSharedList, MemSharedSet, cfg

# dill/pickle protocol
cfg.protocol = 5

d = MemSharedDict({3: 323}, name="d1", size=1024)
l = MemSharedList([3, 323], name="l1", size=1024)
s = MemSharedSet({3, 6, 5}, name="s1", size=1024)

d[111] = 444
d.pop(3)
d[9] = lambda h: h * 3
# to clean up: d.cleanup()

FILE 2

from sharedbuiltinmutables import MemSharedDict, MemSharedList, MemSharedSet, cfg

# dill/pickle protocol
cfg.protocol = 5

d = MemSharedDict(name="d1", size=1024)
# passing a value ( d = MemSharedDict({33:11,3:3} name="d1", size=1024) )
# won't do anything if
# the dict has already been created by another proc
#
# use instead:
# d = MemSharedDict(name="d1", size=1024)
# d.clear()
# d.update({33:11,3:3})
l = MemSharedList(name="l1", size=1024)
s = MemSharedSet(name="s1", size=1024)
# to clean up: d.cleanup()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sharedbuiltinmutables-0.11.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

sharedbuiltinmutables-0.11-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file sharedbuiltinmutables-0.11.tar.gz.

File metadata

  • Download URL: sharedbuiltinmutables-0.11.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for sharedbuiltinmutables-0.11.tar.gz
Algorithm Hash digest
SHA256 3cec279d1d9d75ac1782f803ec4a002cd755ca0fdb8ed6fae8bebe437adb71f5
MD5 273f53f5ce165151723ffade37442fc6
BLAKE2b-256 1149b3088157570e70650779ff86b2668c14567e1d700693366e7c5e25af5aee

See more details on using hashes here.

File details

Details for the file sharedbuiltinmutables-0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for sharedbuiltinmutables-0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 6e7c25ccdcf03b06df4528fa5ed9fa177d8f61714260d9d8a864a8d0a855a2e8
MD5 813d443481cb6adc60614caaed0b52fa
BLAKE2b-256 d928570ef38410dd18dab9d52a4fd735ed9e16cb69c85287f5b0fd940455b046

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page