Investigate dividing into sub-modules
As per Jake's review:
-- The JetStream module -- Consists of: -- - function to create a Model -- - function to create a Scope -- - function to create a Server
-- - function to create a Transport
-- JetStream consists of four concrete primitives.
-- - Model + Scope. Used to define your models and your -- databases. These are the data structures and the -- relationships -- - Sync algorithm. There is an algorithm to sync changes -- between two scopes across processes. This sync algorithm -- is based around SyncFragment. The sync algorithm and -- protocol can be IO agnostic. -- - The transport layer. There is a WebSocket transport for -- doing actual IO. Ideally this would be a stream. -- - The session server. There is a server that can make
-- connections with client and estabilish sessions
-- These four parts fit together. The session server uses the -- websocket transport. The session server negotiates with -- the client about which scope they want to replicate. -- They then take the Scope and the sync algorithm and -- create a streaming version of the sync algorithm to -- apply over the session which is backed by the websocket
-- transport.
Consider dividing this module into 4 submodules, review:
- [ ] Practicality
- [ ] Manageability
- [ ] Maintanability
- [ ] Documentation and usage