Examples.ECodeMonitor (gt_bridge v0.17.1)

Copy Markdown View Source

I am examples for GtBridge.CodeMonitor, the sole publisher of %ModuleEvent{kind: :recompiled} on the bridge's EventBroker bus.

Examples compose: monitor_pid is the leaf; every later example builds on the verified-running monitor. recompile_event returns the events drained from a real reload, and the negative case (non_project_module_filtered) inherits that proof of life before exercising the filter.

Summary

Functions

I assert the supervised CodeMonitor pid is alive AND has the trace installed on :code_server with itself as tracer. Every later example builds on this. The trace is what makes the bus fire, so all downstream behavior is contingent on it.

I exercise the filter side: stdlib reloads must NOT produce events. Composes on recompile_event (that proves the bus fires when it should); this proves it stays silent when it shouldn't.

I reload an existing project module, drain the bus, and return the events I saw. Building block for downstream examples; the events list is what a real save looks like once the chain is working.

Callback implementation for ExExample.Behaviour.copy/1.

Callback implementation for ExExample.Behaviour.rerun?/1.

Functions

__ex_example__monitor_pid__()

I assert the supervised CodeMonitor pid is alive AND has the trace installed on :code_server with itself as tracer. Every later example builds on this. The trace is what makes the bus fire, so all downstream behavior is contingent on it.

__ex_example__non_project_module_filtered__()

I exercise the filter side: stdlib reloads must NOT produce events. Composes on recompile_event (that proves the bus fires when it should); this proves it stays silent when it shouldn't.

__ex_example__recompile_event__()

I reload an existing project module, drain the bus, and return the events I saw. Building block for downstream examples; the events list is what a real save looks like once the chain is working.

copy(item)

Callback implementation for ExExample.Behaviour.copy/1.

monitor_pid()

@spec monitor_pid() :: pid()

non_project_module_filtered()

@spec non_project_module_filtered() :: [{atom(), module() | nil}]

recompile_event()

@spec recompile_event() :: [{atom(), module() | nil}]

rerun?(arg1)

Callback implementation for ExExample.Behaviour.rerun?/1.