lkn-core v0.3.0 Lkn.Core.Pool View Source

A specialized Supervisor which spawns new Map Instance when required.

Link to this section Summary

Functions

Register a given Puppeteer to an Instance of a given Map

Spwans a new Instances Pool for a given Lkn.Core.Map

Link to this section Functions

Link to this function register_puppeteer(map_key, puppeteer_key, puppeteer_module) View Source

Register a given Puppeteer to an Instance of a given Map.

If required, the Pool will spawn a new Instance, so the Puppeteer do not have to worry about that. The Pool will return the Instance key.

Link to this function spawn_pool(map_key) View Source
spawn_pool(Lkn.Core.Map.k) :: :ok

Spwans a new Instances Pool for a given Lkn.Core.Map.

The Map is expected to be alive before this function is called. After that, it is possible for a Puppeteer to join an Instance of this Map using register_puppeteer.

Note: The Pool lives inside a dedicated Supervisor tree.