Configuration
More Examples
Usepackage.json auto-load for integration services that default-export a Hile service:
Complete Example
Failure And Cleanup Behavior
save()validates fields before mutating memory.- Redis is written before memory and event emission update.
initialize()publishes every config field as a topic.- Cleanup unpublishes topics and removes listeners.
Runtime And Lifecycle Notes
MessageLoadermaps*.msg.*files to routes using@hile/loader.MessageLoader.dispatch(path, data, extras?)invokes the matched handler.MessageModem._send()returns aPromise.MessageModem._send()and_push()use a30_000ms timeout when none is provided. An explicit timeout must be a safe integer from1through2_147_483_647; invalid values throwTypeErrorbefore a message is sent.MessageModem._stream()returns a NodeReadablein object mode.- Stream
timeoutandidleTimeoutvalues use the same1through2_147_483_647ms range. The streamwindowmust be a safe integer from1through64and defaults to1. - Each modem schedules request, total-stream, and idle-stream deadlines through one internal deadline scheduler. This reduces active Node.js timers without changing timeout, cancellation, ordering, or error semantics.
@hile/message-wskeeps publicdecodeMessageFrame()payloads isolated from caller-owned input by default. Its owned WebSocketRawDatapath uses a zero-copy binary Flight payload view internally.- A stream request requires
exec()to return an async iterable. Application.call(namespace, url, data, options)requiresoptions.contextand returns a promise.Application.stream(namespace, url, data, options)requiresoptions.contextand returns a readable stream.Application.publish(topic, payload)returns an object withupdate()andunpublish().Application.subscribe(topic, callback)returns an unsubscribe function.Registrystores service addresses and retained config/topic state under~/.registry.