sync

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 25 Imported by: 8

Documentation

Index

Constants

View Source
const DefaultTimelineLimit = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type PresenceConsumer added in v0.8.6

type PresenceConsumer interface {
	EmitPresence(ctx context.Context, userID string, presence types.Presence, statusMsg *string, ts gomatrixserverlib.Timestamp, fromSync bool)
}

type PresencePublisher added in v0.8.0

type PresencePublisher interface {
	SendPresence(userID string, presence types.Presence, statusMsg *string) error
}

type RequestPool

type RequestPool struct {
	Notifier *notifier.Notifier
	// contains filtered or unexported fields
}

RequestPool manages HTTP long-poll connections for /sync

func NewRequestPool

func NewRequestPool(
	db storage.Database, cfg *config.SyncAPI,
	userAPI userapi.SyncUserAPI, keyAPI keyapi.SyncKeyAPI,
	rsAPI roomserverAPI.SyncRoomserverAPI,
	streams *streams.Streams, notifier *notifier.Notifier,
	producer PresencePublisher, consumer PresenceConsumer, enableMetrics bool,
) *RequestPool

NewRequestPool makes a new RequestPool

func (*RequestPool) OnIncomingKeyChangeRequest

func (rp *RequestPool) OnIncomingKeyChangeRequest(req *http.Request, device *userapi.Device) util.JSONResponse

func (*RequestPool) OnIncomingSyncRequest

func (rp *RequestPool) OnIncomingSyncRequest(req *http.Request, device *userapi.Device) util.JSONResponse

OnIncomingSyncRequest is called when a client makes a /sync request. This function MUST be called in a dedicated goroutine for this request. This function will block the goroutine until a response is ready, or it times out.

Jump to

Keyboard shortcuts

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