stomp: github.com/go-stomp/stomp/server/topic Index | Files

package topic

import "github.com/go-stomp/stomp/server/topic"

Package topic provides implementations of server-side topics.

Index

Package Files

manager.go subscription.go topic.go

type Manager Uses

type Manager struct {
    // contains filtered or unexported fields
}

Manager is a struct responsible for finding topics. Topics are not created by the package user, rather they are created on demand by the topic manager.

func NewManager Uses

func NewManager() *Manager

NewManager creates a new topic manager.

func (*Manager) Find Uses

func (tm *Manager) Find(destination string) *Topic

Finds the topic for the given destination, and creates it if necessary.

type Subscription Uses

type Subscription interface {
    // Send a message frame to the topic subscriber.
    SendTopicFrame(f *frame.Frame)
}

Subscription is the interface that wraps a subscriber to a topic.

type Topic Uses

type Topic struct {
    // contains filtered or unexported fields
}

A Topic is used for broadcasting to subscribed clients. In contrast to a queue, when a message is sent to a topic, that message is transmitted to all subscribed clients.

func (*Topic) Enqueue Uses

func (t *Topic) Enqueue(f *frame.Frame)

Enqueue send a message to the topic. All subscriptions receive a copy of the message.

func (*Topic) Subscribe Uses

func (t *Topic) Subscribe(sub Subscription)

Subscribe adds a subscription to a topic. Any message sent to the topic will be transmitted to the subscription's client until unsubscription occurs.

func (*Topic) Unsubscribe Uses

func (t *Topic) Unsubscribe(sub Subscription)

Unsubscribe causes a subscription to be removed from the topic.

Package topic imports 2 packages (graph) and is imported by 7 packages. Updated 2018-07-16. Refresh now. Tools for package owners.