channel

package
v0.0.0-...-8b3bf69 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChannelClosed = errors.New("channel closed")
)

Functions

This section is empty.

Types

type Channel

type Channel struct {
	Id string
	// contains filtered or unexported fields
}

func (*Channel) AddPrioritizedCookies

func (ch *Channel) AddPrioritizedCookies(cookies []*http.Cookie) error

func (*Channel) AwaitHandler

func (ch *Channel) AwaitHandler(handlerFn ChannelHandler)

func (*Channel) Close

func (ch *Channel) Close()

func (*Channel) Closed

func (ch *Channel) Closed() <-chan struct{}

func (*Channel) Context

func (ch *Channel) Context() context.Context

func (*Channel) CountOutgoing

func (ch *Channel) CountOutgoing()

func (*Channel) DequeueOutgoingNonblock

func (ch *Channel) DequeueOutgoingNonblock() (*message.MessageBuilder, error)

func (*Channel) DequeueOutgoingTimeout

func (ch *Channel) DequeueOutgoingTimeout(timeout time.Duration) (
	*message.MessageBuilder, error,
)

func (*Channel) EnqueueIncomingNonblock

func (ch *Channel) EnqueueIncomingNonblock(msg *message.Message) error

func (*Channel) EnqueueOutgoing

func (ch *Channel) EnqueueOutgoing(
	ctx context.Context,
	msgb message.MessageBuilder,
) error

func (*Channel) EnqueueOutgoingNonblock

func (ch *Channel) EnqueueOutgoingNonblock(msgb message.MessageBuilder) error

func (*Channel) GetClientPollDelay

func (ch *Channel) GetClientPollDelay() time.Duration

func (*Channel) HandlerData

func (ch *Channel) HandlerData() interface{}

func (*Channel) HandlerDataUpdated

func (ch *Channel) HandlerDataUpdated() <-chan interface{}

func (*Channel) HasNoOutgoingMessages

func (ch *Channel) HasNoOutgoingMessages() bool

func (*Channel) Incomings

func (ch *Channel) Incomings() <-chan *message.Message

func (*Channel) IsClosed

func (ch *Channel) IsClosed() bool

func (*Channel) IsStaleDuration

func (ch *Channel) IsStaleDuration(past time.Duration) bool

func (*Channel) LogFields

func (ch *Channel) LogFields() logrus.Fields

func (*Channel) PeekIncoming

func (ch *Channel) PeekIncoming() (*message.Message, error)

func (*Channel) PickPriorityCookies

func (ch *Channel) PickPriorityCookies() []*http.Cookie

func (*Channel) PopPriorityCookies

func (ch *Channel) PopPriorityCookies() []*http.Cookie

func (*Channel) PopPriorityData

func (ch *Channel) PopPriorityData() []*http.Cookie

NOTE: This method could also return smth else besides cookies...

func (*Channel) Receive

func (ch *Channel) Receive() (*message.Message, error)

func (*Channel) ReceiveNonblock

func (ch *Channel) ReceiveNonblock() (*message.Message, error)

func (*Channel) ResponseBuilder

func (ch *Channel) ResponseBuilder() message.MessageBuilder

func (*Channel) RunMiddlewares

func (ch *Channel) RunMiddlewares(msg *message.Message) error

func (*Channel) Send

func (ch *Channel) Send(b []byte) error

func (*Channel) SendCookies

func (ch *Channel) SendCookies(cookies []*http.Cookie) error

func (*Channel) SendNonblock

func (ch *Channel) SendNonblock(b []byte) error

func (*Channel) SendProto

func (ch *Channel) SendProto(p protobuf.Message) error

func (*Channel) SendProtoNonblock

func (ch *Channel) SendProtoNonblock(p protobuf.Message) error

func (*Channel) SetHandlerData

func (ch *Channel) SetHandlerData(hd interface{}) error

func (*Channel) Shutdown

func (ch *Channel) Shutdown() <-chan struct{}

func (*Channel) Terminate

func (ch *Channel) Terminate(b []byte) error

func (*Channel) TerminateNonblock

func (ch *Channel) TerminateNonblock(b []byte) error

func (*Channel) TerminateProto

func (ch *Channel) TerminateProto(p protobuf.Message) error

func (*Channel) TerminateProtoNonblock

func (ch *Channel) TerminateProtoNonblock(p protobuf.Message) error

func (*Channel) TerminateStatus

func (ch *Channel) TerminateStatus(code int) error

func (*Channel) TerminateStatusNonblock

func (ch *Channel) TerminateStatusNonblock(code int) error

func (*Channel) TerminationStatus

func (ch *Channel) TerminationStatus() (bool, error)

type ChannelBuilder

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

func Builder

func Builder() ChannelBuilder

func (ChannelBuilder) Build

func (b ChannelBuilder) Build() (*Channel, error)

func (ChannelBuilder) WithId

func (b ChannelBuilder) WithId(id string) ChannelBuilder

func (ChannelBuilder) WithMiddlewares

func (b ChannelBuilder) WithMiddlewares(mws []ChannelMiddleware) ChannelBuilder

func (ChannelBuilder) WithShutdownContext

func (b ChannelBuilder) WithShutdownContext(ctx context.Context) ChannelBuilder

func (ChannelBuilder) WithTimings

type ChannelHandler

type ChannelHandler func(*Channel) error

type ChannelMiddleware

type ChannelMiddleware interface {
	Clone() ChannelMiddleware
	RunBeforePolling(*Channel, *message.Message) error
}

type Channels

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

func NewChannels

func NewChannels() *Channels

func (*Channels) CloseAndDropStale

func (c *Channels) CloseAndDropStale(past time.Duration) uint

func (*Channels) Drop

func (c *Channels) Drop(ch *Channel)

func (*Channels) GetByIdUnsafe

func (c *Channels) GetByIdUnsafe(id string) (*Channel, bool)

func (*Channels) Lock

func (c *Channels) Lock()

func (*Channels) SetByIdUnsafe

func (c *Channels) SetByIdUnsafe(ch *Channel)

func (*Channels) Unlock

func (c *Channels) Unlock()

Jump to

Keyboard shortcuts

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