mm-services-events

Event dispatching service for MicroMinion platform

Usage no npm install needed!

<script type="module">
  import mmServicesEvents from 'https://cdn.skypack.dev/mm-services-events';
</script>

README

mm-services-events

Event dispatching service for MicroMinion platform

Initialization

var MicroMinionPlatform = require('mm-platform')
var Events = require('mm-services-events')

var platform = new MicroMinionPlatform()

var events = new Events({
platform: platform,
logger: platform._log
)}

Messaging API

Published messages

This service can republish any message that is published on local bus to a remote host given that this remote host has send subscribe message.

Subscribed messages

Subscribe messages subscribe remote hosts to events published on local bus. Subscriptions expire after 5 minutes.

platform.messaging.send('events.subscribe', remoteHostKey, {topic: topicName})