fission

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: MIT Imports: 2 Imported by: 1

README

fission

Fission is an implementation of the publish-subscribe model. It does not care about the implementation details and usage of distribution. Fission only cares about the abstraction itself.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Center

type Center struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCenter

func NewCenter(key any) *Center

func (*Center) AddDistributor

func (c *Center) AddDistributor(d *Distributor)

func (*Center) DelDistributor

func (c *Center) DelDistributor(key any)

func (*Center) Fission

func (c *Center) Fission(data any) error

func (*Center) GetDistributors added in v1.0.0

func (c *Center) GetDistributors() map[any]*Distributor

type CenterManager

type CenterManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewCenterManager

func NewCenterManager() *CenterManager

func (*CenterManager) Destroy

func (m *CenterManager) Destroy()

func (*CenterManager) PutCenter

func (m *CenterManager) PutCenter(key any) (c *Center)

type CreateDistributionHandleFunc

type CreateDistributionHandleFunc func(ctx context.Context, key any) Distribution

type Distribution

type Distribution interface {
	Dist(data any) error
	Close() error
}

type Distributor added in v1.0.0

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

func NewDistributor added in v1.0.0

func NewDistributor(ctx context.Context, key any, createDist CreateDistributionHandleFunc) *Distributor

func (*Distributor) Close added in v1.0.0

func (p *Distributor) Close() error

func (*Distributor) Push added in v1.0.0

func (p *Distributor) Push(data any) error

Push push data to the dispatcher, the dispatcher handles the data distribution.

type DistributorManager

type DistributorManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewDistributorManager

func NewDistributorManager() *DistributorManager

func (*DistributorManager) Destroy

func (m *DistributorManager) Destroy()

func (*DistributorManager) PutDistributor

func (m *DistributorManager) PutDistributor(ctx context.Context, key any, distributionCreator CreateDistributionHandleFunc) (p *Distributor)

Jump to

Keyboard shortcuts

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