Object description
SharedStore is a process-wide, memory-only key/value store. Stores with the same namespace share values across ZPE runtimes in the same process.
Availability: SharedStore was added in ZPE 1.14.11.
Object functions
- _construct [1.14.11+]
Opens a named process-wide, memory-only shared store.
- delete [1.14.11+]
Removes a value from the shared store.
- get [1.14.11+]
Returns the value stored for a key, or an optional default value.
- has [1.14.11+]
Returns whether a non-expired value exists for a key.
- set [1.14.11+]
Stores a string, number, Boolean, list, or map, optionally with a TTL.
- take [1.14.11+]
Returns a value and removes it from the shared store.
Example
YASS
$store = new SharedStore("chat") $store->set("message", "Hello") print($store->get("message"))

There are no comments on this page.
Comments are welcome and encouraged, including disagreement and critique. However, this is not a space for abuse. Disagreement is welcome; personal attacks, harassment, or hate will be removed instantly. This site reflects personal opinions, not universal truths. If you can’t distinguish between the two, this probably isn’t the place for you. The system temporarily stores IP addresses and browser user agents for the purposes of spam prevention, moderation, and safeguarding. This data is automatically removed after fourteen days. Your email address is stored so that replies can be sent to your email address.
Comments powered by BalfComment