API Reference stargate v0.2.0
Modules
Stargate provides an Elixir client for the Apache Pulsar distributed message log service, based on the Pulsar project's websocket API.
Connection provides the core abstraction for the websocket connection between the client application and the Pulsar cluster shared by all Stargate producer, reader, and consumer processes.
This module provides the function to generate query parameters for establishing a consumer connection to a topic and subscription with Pulsar.
Defines the Elixir Struct that represents the structure of a Pulsar message. The struct combines the "location" data of the received messages (persistent vs. non-persistent, tenant, namespace, topic) with the payload, any key and/or properties provided with the message, and the publication timestamp as an DateTime struct, and the messageId assigned by the cluster.
Provides a producer websocket process and functions for producing messages to the cluster.
By default, Stargate.produce/2
will block the calling
process until acknowledgement is received from Pulsar that the
message was successfully produced. This can optionally switch
to an asynchronous acknowledgement by passing an MFA tuple to
Stargate.produce/3
.
This modules provides the function to generate query parameters for establishing a producer connection to a topic with Pulsar.
Defines the state stored by the producer websocket process. The Stargate producer records the registry name associated to its supervision tree, the URL of the cluster and topic it connects to, as well as the individual components that make up the URL including the host, protocol (ws or wss), topic path parameters (persistent or non-persistent, tenant, namespace, and topic) and any query parameters configuring the connection.
Creates and manages a supervisor process for the Stargate producer websocket process and acknowledger process.
This module provides the function to generate query parameters for establishing a reader connection to a topic with Pulsar.
Provides a Stargate websocket process that can be either a reader or consumer connection based on the configuration passed when starting the process.
Defines the Stargate.Receiver.Acknowledger
GenStage process
that acts as the final consumer in the receive pipeline to
acknowledge successful processing of messages back to Pulsar
to allow more messages to be sent and for the cluster to
delete messages from the subscription in the case of consumers.
Defines the struct used by a Stargate.Receiver.Acknowledger
to store its state. Includes the type of the receiver (reader
or consumer), the name of the process registry associated with
the client supervision tree, the atom key of the receiver socket
process within the process registry, and the path parameters
of the topic connection (tenant, namespace, topic).
Defines the Stargate.Receiver.Dispatcher
GenStage process
that functions as the producer in the pipeline, receiving messages
pushed from the reader or consumer socket and dispatching to the
rest of the pipeline.
Defines the struct used by a Stargate.Receiver.Dispatcher
to store its state.
Defines the MessageHandler
behaviour required by a module
passed to a Stargate reader or consumer.
Defines a Stargate.Receiver.Processor
module as a GenStage
process under the consumer or reader supervision tree.
Defines the struct Stargate.Receiver.Processor
uses
to store its state.
Defines the state stored by the consumer or reader websocket process. The Stargate receiver records the registry name associated to its supervision tree, the URL of the cluster and topic it connects to, as well as the individual components that make up the URL including the host, protocol (ws or wss), topic path parameters (persistent or non-persistent, tenant, namespace, and topic) and any query parameters configuing the connection.
Defines a supervisor for the Stargate.Receiver
reader
and consumer connections and the associated GenStage pipeline
for processing and acknowledging messages received on the connection.
This module defines a top-level supervisor for your Stargate client. It takes a keyword list of configuration values for connecting to the cluster and any producers, readers, or consumers desired, and orchestrates the starting of the process registry and the websocket client(s).