barrel_design_modules (barrel_design v0.1.0)
View SourceNode-wide holder of loaded guest modules.
erlang_wasm keeps one decoded, validated module per SHA-256 for as long as some process holds a load claim, and instances do not hold one. This process holds the claim: users acquire a digest and release it, and the module is unloaded when its last user has released it or exited. Users release only after their in-flight guest calls have finished, so unloading never races a call. A user is monitored while it holds a claim on any digest, and no longer once its last claim is released. A cache restart drops every module; reload/1 loads the digest again from the bytes kept here.
Summary
Functions
Load (or share) the module with this digest for the caller.
Share a module already resident, without its bytes.
Resident digests with their user counts, the number of engine loads this holder has made since it started, and the users monitored.
Drop one of the caller's claims on Digest.
Load the digest again after the engine lost it.
Functions
Load (or share) the module with this digest for the caller.
Share a module already resident, without its bytes.
-spec info() -> #{resident := #{binary() => non_neg_integer()}, loads := non_neg_integer(), monitors := non_neg_integer()}.
Resident digests with their user counts, the number of engine loads this holder has made since it started, and the users monitored.
-spec release(binary()) -> ok.
Drop one of the caller's claims on Digest.
Load the digest again after the engine lost it.