Skip to main content

Configuration

More Examples

Use package.json auto-load for integration services that default-export a Hile service:
Inside another service, load dependencies:

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

  • MessageLoader maps *.msg.* files to routes using @hile/loader.
  • MessageLoader.dispatch(path, data, extras?) invokes the matched handler.
  • MessageModem._send() returns a Promise.
  • MessageModem._stream() returns a Node Readable in object mode.
  • A stream request requires exec() to return an async iterable.
  • Application.call(namespace, url, data, options?) returns a promise.
  • Application.stream(namespace, url, data, options?) returns a readable stream.
  • Application.publish(topic, payload) returns an object with update() and unpublish().
  • Application.subscribe(topic, callback) returns an unsubscribe function.
  • Registry stores service addresses and retained config/topic state under ~/.registry.