Event and request handlers for microservice communication in Orionjs
@Echoes()
and @EchoRequest()
or @EchoEvent()
decorators, you can easily create handlers for both synchronous requests and asynchronous events.
@Echoes()
that contains methods decorated with @EchoRequest()
or @EchoEvent()
:
@EchoRequest()
decorator with the createEchoRequest()
function to define methods that handle synchronous requests from other services:
@EchoEvent()
decorator with the createEchoEvent()
function to define methods that process asynchronous events:
createEchoEvent()
function accepts options similar to createEchoRequest()
:
@Inject(() => Service)
to access repositories and services.