sync

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: AGPL-3.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTimelineLimit = 20

Variables

This section is empty.

Functions

This section is empty.

Types

type PresenceConsumer

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

type PresenceMap

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

set a unix timestamp of when it last saw the types this way it can filter based on time

type PresencePublisher

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,
	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