Overview

An actor in Streamer refers to a component or entity within a system that generates, processes, and responds to events. The actors have internal states that are invisible and inaccessible to external modules. The actors communicate by relying on events to interact with each other. In Streamers, the inter-actor communication is generally asynchronous, although synchronous communication is also allowed in some cases for convenience. An actor generally communicates only with the event broker it is connected to.

Definition

type Actor struct {
	receiver chan interface{}

	Producer    streamer.Producer
	name        string
	subscribeTo []string
	workerThd   IWorker
	broker      *streamer.StatefulBroker
}

Producer/Consumer

An actor can be either a producer, a consumer, or, most cases, both. A producer is defined as an entity that generates and emits events to the broker. A consumer is a component that subscribes to, receives, and processes events from the broker. In Streamer, most actors function as both producers and consumers simultaneously.

Last updated