AvailLang/Avail

Move AvailServer AvailRuntime to Session

Closed this issue · 3 comments

Presently, the AvailServer holds on to one shared AvailRuntime. The result is that each connected AvailServerChannel Command channel (User - Session) shares the single runtime. Provide an option to have each Session have its own AvailRuntime.

Each AvailServerChannel command channel has a Session. Each child AvailServerChannel (non-command channel) spawned by the parent command channel shares access to the parent's Session.

This ticket requires the following:

  1. Create AvailServer configurable option that allows for either, a) preserving a single shared AvailRuntime(present state) or b) allow for each Session to hold its own AvailRuntime
  2. Create AvailRuntime on Session that will either be a reference to the shared AvailServer AvailRuntime (a) or have its own AvailRuntime (b) so there is one per Session.
  3. Allow AvailRuntime to be shared between sessions via a token (b)
  4. AvailServer jar flag indicates to optionally run using environment variable AVAIL_ROOTS to pre-populate AvailRuntime with predefined ModuleRoots.
  5. Add AvailServer API feature that allows client to add/remove/create a ModuleRoot.

To generalize this, we could introduce an abstract AvailServer layer with the handling of the AvailRuntime/ AvailBuilder left to the concrete implementation. The Session will hold on to a reference to both an AvailRuntime & AvailBuilder handed to it by the AvailServer. Depending on the AvailServer implementation it will either be a reference to the single shared runtime or a new one.

With different AvailRuntimes and generalizing ModuleRoot source origin, #194, I'm not sure what we will do about the Repositorys (build artifacts). This is a level of complexity not yet discussed and probably should be ironed out before either task is completed.

The switch to Anvil development has shifted focus away from AvailServer development. AvailServer development has been stagnant for sometime. In the event AvailServer is revisited, we will re-establish requirements at that time.