Documentation ¶
Overview ¶
gokaf is a robust in-memory pubsub engine meticulously crafted to provide seamless and nearly real-time data streams.
Index ¶
- type Consumer
- type Engine
- func (e *Engine) GetConsumer(topicName string, handler func(interface{})) (*Consumer, error)
- func (e *Engine) GetProducer(topicName string) (*Producer, error)
- func (e *Engine) RegisterTopic(topicName string, bufferSize int) error
- func (e *Engine) Stop()
- func (e *Engine) TopicExists(topicName string) bool
- type Producer
- type TopicClosedError
- type TopicExistsError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer struct represents a subscriber in the pubsub system.
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine struct represents the core of a pubsub system, managing topics and their associated consumers.
func NewEngine ¶
NewEngine creates a new Engine instance, initializing the necessary components for the pubsub system.
func (*Engine) GetConsumer ¶
GetConsumer retrieves or creates a new consumer associated with the specified topic in the pubsub engine.
func (*Engine) GetProducer ¶
GetProducer retrieves or creates a new producer associated with the specified topic in the pubsub engine.
func (*Engine) RegisterTopic ¶
RegisterTopic creates and registers a new topic within the pubsub engine with the specified name and buffer size.
func (*Engine) Stop ¶
func (e *Engine) Stop()
Stop terminates the pubsub engine, initiating a graceful shutdown process.
func (*Engine) TopicExists ¶
TopicExists checks if a specified topic exists within the pubsub engine.
type Producer ¶
type Producer struct {
// contains filtered or unexported fields
}
Producer struct represents a message producer in the pubsub system.
type TopicClosedError ¶
type TopicClosedError struct {
// contains filtered or unexported fields
}
TopicClosedError is a custom error type for indicating that a topic is already closed.
func (TopicClosedError) Error ¶
func (e TopicClosedError) Error() string
Error returns a string representation of the TopicClosedError.
type TopicExistsError ¶
type TopicExistsError struct {
// contains filtered or unexported fields
}
TopicExistsError is a custom error type for indicating that a topic already exists.
func (TopicExistsError) Error ¶
func (e TopicExistsError) Error() string
Error returns a string representation of the TopicExistsError.