msgdispatcher

package
v0.0.0-...-1593278 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MaxTolerantLag        = 3 * time.Second
	DefaultTargetChanSize = 1024
)

TODO: dyh, move to config

View Source
var (
	CheckPeriod = 1 * time.Second // TODO: dyh, move to config
)

Functions

This section is empty.

Types

type Client

type Client interface {
	Register(vchannel string, pos *Pos, subPos SubPos) (<-chan *MsgPack, error)
	Deregister(vchannel string)
	Close()
}

func NewClient

func NewClient(factory msgstream.Factory, role string, nodeID int64) Client

type Dispatcher

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

func NewDispatcher

func NewDispatcher(factory msgstream.Factory,
	isMain bool,
	pchannel string,
	position *Pos,
	subName string,
	subPos SubPos,
	lagNotifyChan chan struct{},
	lagTargets *sync.Map,
) (*Dispatcher, error)

func (*Dispatcher) AddTarget

func (d *Dispatcher) AddTarget(t *target)

func (*Dispatcher) CloseTarget

func (d *Dispatcher) CloseTarget(vchannel string)

func (*Dispatcher) CurTs

func (d *Dispatcher) CurTs() typeutil.Timestamp

func (*Dispatcher) GetTarget

func (d *Dispatcher) GetTarget(vchannel string) (*target, error)

func (*Dispatcher) Handle

func (d *Dispatcher) Handle(signal signal)

func (*Dispatcher) TargetNum

func (d *Dispatcher) TargetNum() int

type DispatcherManager

type DispatcherManager interface {
	Add(vchannel string, pos *Pos, subPos SubPos) (<-chan *MsgPack, error)
	Remove(vchannel string)
	Num() int
	Run()
	Close()
}

func NewDispatcherManager

func NewDispatcherManager(pchannel string, role string, nodeID int64, factory msgstream.Factory) DispatcherManager

type MockClient

type MockClient struct {
	mock.Mock
}

MockClient is an autogenerated mock type for the Client type

func NewMockClient

func NewMockClient(t mockConstructorTestingTNewMockClient) *MockClient

NewMockClient creates a new instance of MockClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.

func (*MockClient) Close

func (_m *MockClient) Close()

Close provides a mock function with given fields:

func (*MockClient) Deregister

func (_m *MockClient) Deregister(vchannel string)

Deregister provides a mock function with given fields: vchannel

func (*MockClient) EXPECT

func (_m *MockClient) EXPECT() *MockClient_Expecter

func (*MockClient) Register

func (_m *MockClient) Register(vchannel string, pos *msgpb.MsgPosition, subPos mqwrapper.SubscriptionInitialPosition) (<-chan *msgstream.MsgPack, error)

Register provides a mock function with given fields: vchannel, pos, subPos

type MockClient_Close_Call

type MockClient_Close_Call struct {
	*mock.Call
}

MockClient_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close'

func (*MockClient_Close_Call) Return

func (*MockClient_Close_Call) Run

func (_c *MockClient_Close_Call) Run(run func()) *MockClient_Close_Call

type MockClient_Deregister_Call

type MockClient_Deregister_Call struct {
	*mock.Call
}

MockClient_Deregister_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Deregister'

func (*MockClient_Deregister_Call) Return

func (*MockClient_Deregister_Call) Run

func (_c *MockClient_Deregister_Call) Run(run func(vchannel string)) *MockClient_Deregister_Call

type MockClient_Expecter

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

func (*MockClient_Expecter) Close

Close is a helper method to define mock.On call

func (*MockClient_Expecter) Deregister

func (_e *MockClient_Expecter) Deregister(vchannel interface{}) *MockClient_Deregister_Call

Deregister is a helper method to define mock.On call

  • vchannel string

func (*MockClient_Expecter) Register

func (_e *MockClient_Expecter) Register(vchannel interface{}, pos interface{}, subPos interface{}) *MockClient_Register_Call

Register is a helper method to define mock.On call

  • vchannel string
  • pos *msgpb.MsgPosition
  • subPos mqwrapper.SubscriptionInitialPosition

type MockClient_Register_Call

type MockClient_Register_Call struct {
	*mock.Call
}

MockClient_Register_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Register'

func (*MockClient_Register_Call) Return

func (*MockClient_Register_Call) Run

type MsgPack

type MsgPack = msgstream.MsgPack

type Pos

type Pos = msgpb.MsgPosition

Jump to

Keyboard shortcuts

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