Module Emitter

An 'Emitter' is a class that can be used to send payloads to a Snowplow collector attached to a 'tracker' instance.

Info:

  • Copyright: Snowplow Analytics Ltd
  • License: Apache License Version 2.0
  • Author: Greg Leonard

Functions

get_request_method ()
get_collector_url ()
send (payload) Sends a payload to the collector with the configured request method.
emitter.new (collector_url[, request_method="POST"]) Builds a new emitter instance.

Tables

Emitter The Emitter table.


Functions

get_request_method ()

Returns:

    string The Emitter instance request method
get_collector_url ()

Returns:

    string The Emitter instance collector url
send (payload)
Sends a payload to the collector with the configured request method.

Parameters:

  • payload string The payload to send

Returns:

  1. boolean Whether event was successfully collected
  2. optional string The reason for failure if not
emitter.new (collector_url[, request_method="POST"])
Builds a new emitter instance.

Parameters:

  • collector_url string The url of the collector
  • request_method string The request method to use (default "POST")

Returns:

    Emitter The new emitter instance

Tables

Emitter
The Emitter table.

Fields:

  • get_request_method func
  • get_collector_url func
  • send func
generated by LDoc 1.4.6 Last updated 2022-04-28 16:24:12