poa_backend v0.1.0 POABackend.Receivers.DynamoDB View Source

This is a Receiver Plugin which stores the received Ethereum Blocks in DynamoDB

This Receiver needs some data to be put in the config file (receivers section), for example:

{:dynamodb_receiver, POABackend.Receivers.DynamoDB, [
      scheme: "http://",
      host: "localhost",
      port: 8000,
      access_key_id: "myaccesskeyid",
      secret_access_key: "mysecretaccesskey",
      region: "us-east-1"
      ]}
  • scheme: the scheme type
  • host: host name or url
  • port: the TCP port where the DynamoDB instance is listening
  • access_key_id: the AWS access key
  • secret_access_key: the AWS secret access key
  • region: the AWS region

All fields are mandatory

Link to this section Summary

Functions

This function is called when a Custom Handler detects a client is inactive

In this callback is called when the Receiver process receives an erlang message

A callback executed when the Receiver Plugin starts. The argument is retrieved from the configuration file when the Receiver is defined It must return {:ok, state}, that state will be keept as in GenServer and can be retrieved in the metrics_received/3 function

This callback will be called every time a message to the subscribed metric type arrives. It must return the tuple {:ok, state}

This callback is called just before the Process goes down. This is a good place for closing connections

Link to this section Functions

Link to this function handle_inactive(_, state) View Source

This function is called when a Custom Handler detects a client is inactive.

The Custom Handler must to call explicity to POABackend.CustomHandler.publish_inactive/1 and it will publish the inactive message to all the metrics in the system (defined in the config file).

Callback implementation for POABackend.Receiver.handle_inactive/2.

Link to this function handle_message(message, state) View Source

In this callback is called when the Receiver process receives an erlang message.

It must return {:ok, state}.

Callback implementation for POABackend.Receiver.handle_message/2.

A callback executed when the Receiver Plugin starts. The argument is retrieved from the configuration file when the Receiver is defined It must return {:ok, state}, that state will be keept as in GenServer and can be retrieved in the metrics_received/3 function.

Callback implementation for POABackend.Receiver.init_receiver/1.

Link to this function metrics_received(metrics, from, state) View Source

This callback will be called every time a message to the subscribed metric type arrives. It must return the tuple {:ok, state}

Callback implementation for POABackend.Receiver.metrics_received/3.

This callback is called just before the Process goes down. This is a good place for closing connections.

Callback implementation for POABackend.Receiver.terminate/1.