Skip to main content

shmem

Functionality that allows to share data between processes.

open

function shmem.open(namespace: string, capacity: integer)
-> shmem|nil
2. errmsg: string

Open a shared memory container.


__pairs

(method) shmem:__pairs()
-> function

Implements the pairs metamethod for easy traversal of elements.


capacity

(method) shmem:capacity()
-> integer

Maximum amount of elements the shared memory container can store.


clear

(method) shmem:clear()

Remove all elements from the shared memory container.


get

(method) shmem:get(name_or_index: string|integer)
-> data: string?

Retrieve the element data from the shared memory container.


remove

(method) shmem:remove(name: string)

Removes the specified element from the shared memory container.


set

(method) shmem:set(name: string, value: string)
-> updated: boolean

Adds or edits an existing element on the shared memory container.


size

(method) shmem:size()
-> integer

The amount of elements residing on the shared memory container.