Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
762 B 23 lines
123456789101112131415161718192021222324//// A store query waits for its answer with no deadline, so a store that stops//// must end the wait at once. A daemon run never stops its store under a//// waiting caller, so only this test sees a hang there.
import albedo/daemon/storeimport gleam/erlang/process
pub fn a_query_on_a_stopped_store_fails_at_once_test() -> Nil { let assert Ok(db) = store.start(":memory:", "") store.close(db) let caller = process.spawn_unlinked(fn() { store.query(db, fn(_) { Nil }) Nil }) let monitor = process.monitor(caller) let assert Ok(_) = process.new_selector() |> process.select_specific_monitor(monitor, fn(down) { down }) |> process.selector_receive(1000) as "the caller is still waiting on a stopped store" Nil}