core / pragma.services / DistributedService /

DistributedService #

abstract class DistributedService(pragmaNode: PragmaNode, instanceId: UUID) : Service

A service that handles RPC requests across one or more nodes.

Constructors #

DistributedService

fun DistributedService(pragmaNode: PragmaNode, instanceId: UUID)

Functions #

NameSummary

onSessionTerminated

open suspend fun onSessionTerminated(notification: PlayerSessionRpc.SessionTerminatedForServiceV1Notification)

Java does not support annotation inheritance, so if the function is "overridden", the overriding classes need to redeclare the @PragmaNotification annotation. See https://stackoverflow.com/questions/1624084/why-is-it-not-possible-to-extend-annotations-in-java

Inheritors #

Name

TelemetryService

Extensions #

NameSummary

notifyAllActiveSessionsImpl

internal fun <Request : Request, Response : GeneratedMessage> DistributedService.notifyAllActiveSessionsImpl(localNotificationRequest: Request, parseResponse: ParseFromFunction<Response>)

Direct-routes localNotificationRequest to every distributed instance of the calling service, including this one. The request is identical for each instance - only the routing target varies - and the response is empty, so callers pass a prebuilt request rather than a per-instance builder.

notifyLocalActiveSessionsImpl

internal suspend fun DistributedService.notifyLocalActiveSessionsImpl(sessionManager: SessionManager, notification: ExternalNotification, batchSize: Int = DEFAULT_NOTIFY_ALL_BATCH_SIZE, batchIntervalMillis: Long = DEFAULT_NOTIFY_ALL_BATCH_INTERVAL_MILLIS, pragmaIdOf: (PragmaSession) -> UUID)

Delivers notification to every session held by this instance.