Skip to content

Enable heir and give away #4

@chouzar

Description

@chouzar

https://www.erlang.org/doc/apps/stdlib/ets#heir

{heir,Pid,HeirData} | {heir,none} - Set a process as heir. The heir inherits the table if the owner terminates. Message {'ETS-TRANSFER',tid(),FromPid,HeirData} is sent to the heir when that occurs. The heir must be a local process. Default heir is none, which destroys the table when the owner terminates.

https://www.erlang.org/doc/apps/stdlib/ets.html#give_away/3

give_away(Table, Pid, GiftData)

-spec give_away(Table, Pid, GiftData) -> true when Table :: table(), Pid :: pid(), GiftData :: term().

Make process Pid the new owner of table Table. If successful, message {'ETS-TRANSFER',Table,FromPid,GiftData} is sent to the new owner.

The process Pid must be alive, local, and not already the owner of the table. The calling process must be the table owner.

Notice that this function does not affect option heir of the table. A table owner can, for example, set heir to itself, give the table away, and then get it back if the receiver terminates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions