kernel.core.message
Defines what kinds of messages are exchanged among sites.
There are three kinds of messages:
- An operation message carries a compound operation that is to be executed on all sites in the system.
- A heartbeat message carries a site’s latest vector clock. This is used as a performance optimization for the garbage collector (without periodic heartbeats, no operations can be garbage collected). They also announce a newly joined site.
- A leave message announces that a site has left.
Every message forwarded by the server contains the server’s own vector clock. This is required for garbage collection, as the server also has to receive an operation for it to be kernel.core.garbage-collector/eligible?. This is particularly important when only one client is connected to the server, so that the client does not immediately garbage collect its own operations.
get-server-VC
(get-server-VC message)
Returns a message’s server vector clock. Not every message carries this vector clock (i.e., forwarded messages and heartbeats for joined sites).
get-site-ID
(get-site-ID message)
Returns a message’s site. This is the site that issued the message, or a site that has left.
get-type
(get-type message)
Returns a message’s type, one of :heartbeat, :leave or nil (operation).
get-VC
(get-VC message)
Returns a message’s vector clock, if any. Leave messages do not carry a vector clock.
update-VC
(update-VC message f)
Updates a message’s vector clock with a given updater function.