sync

package
v1.1.43 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: AGPL-3.0 Imports: 26 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

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