handler2

package
v0.99.4 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Store *state.Storage
	// contains filtered or unexported fields
}

Handler is responsible for starting v2 pollers at startup; processing v2 data (as a sync2.V2DataReceiver) and publishing updates (pubsub.Payload to V2Listeners); and receiving and processing EnsurePolling events.

func NewHandler

func NewHandler(
	pMap sync2.IPollerMap, v2Store *sync2.Storage, store *state.Storage,
	pub pubsub.Notifier, sub pubsub.Listener, enablePrometheus bool, deviceDataUpdateDuration time.Duration,
) (*Handler, error)

func (*Handler) Accumulate

func (h *Handler) Accumulate(ctx context.Context, userID, deviceID, roomID, prevBatch string, timeline []json.RawMessage)

func (*Handler) AddToDeviceMessages

func (h *Handler) AddToDeviceMessages(ctx context.Context, userID, deviceID string, msgs []json.RawMessage)

func (*Handler) EnsurePolling

func (h *Handler) EnsurePolling(p *pubsub.V3EnsurePolling)

func (*Handler) Initialise

func (h *Handler) Initialise(ctx context.Context, roomID string, state []json.RawMessage) []json.RawMessage

func (*Handler) Listen

func (h *Handler) Listen()

Listen starts all consumers

func (*Handler) OnAccountData

func (h *Handler) OnAccountData(ctx context.Context, userID, roomID string, events []json.RawMessage)

func (*Handler) OnBulkDeviceDataUpdate added in v0.99.4

func (h *Handler) OnBulkDeviceDataUpdate(payload *pubsub.V2DeviceData)

Called periodically by deviceDataTicker, contains many updates

func (*Handler) OnE2EEData

func (h *Handler) OnE2EEData(ctx context.Context, userID, deviceID string, otkCounts map[string]int, fallbackKeyTypes []string, deviceListChanges map[string]int)

func (*Handler) OnExpiredToken added in v0.99.2

func (h *Handler) OnExpiredToken(ctx context.Context, accessTokenHash, userID, deviceID string)

func (*Handler) OnInvite

func (h *Handler) OnInvite(ctx context.Context, userID, roomID string, inviteState []json.RawMessage)

func (*Handler) OnLeftRoom

func (h *Handler) OnLeftRoom(ctx context.Context, userID, roomID string)

func (*Handler) OnReceipt

func (h *Handler) OnReceipt(ctx context.Context, userID, roomID, ephEventType string, ephEvent json.RawMessage)

func (*Handler) OnTerminated

func (h *Handler) OnTerminated(ctx context.Context, userID, deviceID string)

func (*Handler) SetTyping

func (h *Handler) SetTyping(ctx context.Context, roomID string, ephEvent json.RawMessage)

func (*Handler) StartV2Pollers

func (h *Handler) StartV2Pollers()

func (*Handler) Teardown

func (h *Handler) Teardown()

func (*Handler) UpdateDeviceSince

func (h *Handler) UpdateDeviceSince(ctx context.Context, userID, deviceID, since string)

Emits nothing as no downstream components need it.

func (*Handler) UpdateUnreadCounts

func (h *Handler) UpdateUnreadCounts(ctx context.Context, roomID, userID string, highlightCount, notifCount *int)

Jump to

Keyboard shortcuts

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