The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Myriad::Service::Implementation - microservice coördination

SYNOPSIS

DESCRIPTION

ATTRIBUTES

These methods return instance variables.

ryu

Provides a common Ryu::Async instance.

myriad

The Myriad instance which owns this service. Stored internally as a weak reference.

rpc

subscription

service_name

The name of the service, defaults to the package name.

METRICS

General metrics that any service is assumed to have

myriad.service.rpc

Timing information about RPC calls tagged by service, status and method name

myriad.service.batch

Timing information about the batch subscriptions tagged by service, status and method name

myriad.service.receiver

Timing information about events receivers tagged by service, status and method name

myriad.service.emitter

A counter for the events emitted by emitters tagged by service and method name

METHODS

configure

Populate internal configuration.

_add_to_loop

Apply this service to the current event loop.

This will trigger a number of actions:

  • initial startup

  • first diagnostics check

  • if successful, batch and subscription registration will occur

ASYNC METHODS

load

To wire the service with Myriad's component before it actually starts work

start

Perform the diagnostics check and start the service

startup

Initialize the service internal status it will be called when the service is added to the IO::Async::Loop.

The method here is just a placeholder it should be reimplemented by the service code.

diagnostics

Runs any internal diagnostics.

The method here is just a placeholder it should be reimplemented by the service code.

shutdown

Gracefully shut down the service. At the moment, this means we:

  • stop accepting more requests

  • finish the pending requests

INHERITED METHODS

IO::Async::Notifier

add_child, adopt_future, adopted_futures, can_event, children, configure_unknown, debug_printf, get_loop, invoke_error, invoke_event, loop, make_event_cb, maybe_invoke_event, maybe_make_event_cb, notifier_name, parent, remove_child, remove_from_parent

Object::Pad::UNIVERSAL

BUILDARGS

AUTHOR

Deriv Group Services Ltd. DERIV@cpan.org.

See "CONTRIBUTORS" in Myriad for full details.

LICENSE

Copyright Deriv Group Services Ltd 2020-2022. Licensed under the same terms as Perl itself.