-
Notifications
You must be signed in to change notification settings - Fork 3
Description
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.