okami.mom/albedo

git clone https://git.nkp.pet/okami.mom/albedo

Aly Raffauffix(daemon): remove stopped session running marks8d97901

main
499 B15 linesraw
1%% Observe running cache lifetime without loading or waking session actors.
2-module(albedo_running_probe).
3-export([state/1, close/1]).
4
5state(Id) ->
6    Records = case ets:whereis(albedo_running) of
7        undefined -> [];
8        _ -> ets:lookup(albedo_running, Id)
9    end,
10    json:encode(#{running => albedo_bus:running(Id), records => length(Records)}).
11
12close(Id) ->
13    {some, Session} = 'albedo@daemon@session':live(Id),
14    nil = 'albedo@daemon@session':close(Session),
15    <<"closed">>.