pubsub

package
v2.0.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Copyright (c) 2023-2024 Nibi, Inc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBus

type EventBus interface {
	// AddTopic: Adds a new topic with the specified name and message source
	AddTopic(name string, src <-chan coretypes.ResultEvent) error
	// RemoveTopic: Removes the specified topic and all its related data,
	// ensuring clean up of resources.
	RemoveTopic(name string)
	Subscribe(name string) (<-chan coretypes.ResultEvent, UnsubscribeFunc, error)
	Topics() []string
}

EventBus manages topics and subscriptions. A "topic" is a named channel of communication. A "subscription" is the action taken by a subscriber to express interest in receiving messages broadcasted from a specific topic.

func NewEventBus

func NewEventBus() EventBus

NewEventBus returns a fresh imlpemention of `memEventBus`, which implements the `EventBus` interface for managing Ethereum topics and subscriptions.

type UnsubscribeFunc

type UnsubscribeFunc func()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL