Module jc_sequence

This gen_server is a singleton serializing access to the sequence table by which the cache provides support for serialized operations.

Copyright © (C) 2015, Jim Rosenblum

Behaviours: gen_server.

Authors: Jim Rosenblum (jrosenblum@carelogistics.com).

Description

This gen_server is a singleton serializing access to the sequence table by which the cache provides support for serialized operations.

When the gen_server starts it tries to register itself using Global as jc_sequence. If not successful, it monitors the PID currently associated with jc_cluster. If that PID goes down, this gen_server tries to assign itself the global name.

Data Types

seq()

seq() = non_neg_integer() | -1

Function Index

start_link/0Start the server and link the caller to it.
test_set/2Ask the server to do the test_set: If NewSeq is >= to the existing sequence number for the Map, set the sequence to NewSeq and return true, else false.

Function Details

start_link/0

start_link() -> {ok, pid()} | ignore | {error, any()}

Start the server and link the caller to it.

test_set/2

test_set(Map::#{}, NewSeq::seq()) -> true | false

Ask the server to do the test_set: If NewSeq is >= to the existing sequence number for the Map, set the sequence to NewSeq and return true, else false.


Generated by EDoc, May 24 2016, 22:38:41.