handler2

package
v0.99.19 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

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

	PendingTxnIDs *sync2.PendingTransactionIDs
	// 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 string, timeline sync2.TimelineResponse) error

func (*Handler) AddToDeviceMessages

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

func (*Handler) EnsurePolling

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

func (*Handler) ExpireOldPollers added in v0.99.6

func (h *Handler) ExpireOldPollers()

ExpireOldPollers looks for pollers whose devices have not made a sliding sync query in the last 30 days, and asks the poller map to expire their corresponding pollers. This function does not normally need to be called manually (StartV2Pollers queues it up to run hourly); we expose it publicly only for testing purposes.

func (*Handler) Initialise

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

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) error

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) (retErr error)

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) error

func (*Handler) OnLeftRoom

func (h *Handler) OnLeftRoom(ctx context.Context, userID, roomID string, leaveEv json.RawMessage) error

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, pollerID sync2.PollerID)

func (*Handler) SetTyping

func (h *Handler) SetTyping(ctx context.Context, pollerID sync2.PollerID, 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