Module Swarm


module Swarm: sig  end
Implementation of the Swarm design pattern, which serves to harbor multiple interacting residents. In fact, more than one implementation may be contained herein, as the Swarm is first and foremost a module type.

More precisely, a Swarm is an object of type 'a SomeSwarmImplementation(SomeExposure).t, where list

Swarm residents should be created as objects which extend the object signature SomeSwarmImplementation.core. When added to a Swarm - sheltered - they acquire the opaque type 'a resident. The original resident definition class, which extends core, is called the resident core.
See also testing/test_swarm.ml for simple examples of how to use this module.

In the Monod project, this module is used to define elements of the next layer in the design stack, the Incubator - see the Incubator module.


module type EXPOSURE = sig  end
This module separates all the matching computation software away from the residents proper.
exception No_matching_marker
Should be returned by a resident core when the method get_full_marker is called with an inactive projection.
exception Invalid_matchinghalf
Should be returned by a resident core's unimate method when the matchinghalf passed as parameter is invalid (for instance, if it's stale.
exception No_such_binding
Returned to a resident core when a method expects a binding to exist - for instance, transfer or split.
module type SWARM = sig  end
The signature of modules used to define Swarm objects.
module type SWARMMAKER = functor (R : EXPOSURE) -> sig  end
Generic functor to create a module of type SWARM.
module SerializedSwarm: SWARMMAKER
A Swarm implementation - very inefficient, but simple.