Skip to content

@pumpkin-plugins/pumpkin-pie-api API / session / PieSession

Class: PieSession ​

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:31

Plugin-wide expansion ownership, negotiation and bounded recovery. Call tick explicitly.

Constructors ​

Constructor ​

new PieSession(options): PieSession

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:44

One session per calling plugin; no global timers or watcher per line.

Parameters ​

options ​

SessionOptions

Returns ​

PieSession

Accessors ​

state ​

Get Signature ​

get state(): SessionState

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:57

Current negotiation state; only ready consumers should resolve placeholders.

Returns ​

SessionState

Methods ​

appliedCache() ​

appliedCache(namespace): Cache | undefined

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:61

Cache policy from the last successful registration, absent while unavailable.

Parameters ​

namespace ​

string

Returns ​

Cache | undefined


registerExpansion() ​

registerExpansion(namespace, handlers, cache?): void

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:65

Record desired handlers; tick applies them after negotiation and every recovery.

Parameters ​

namespace ​

string

handlers ​

Readonly<Record<string, ExpansionHandler>>

cache? ​

Cache = ...

Returns ​

void


stop() ​

stop(options?): void

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:109

Stop permanently; set unregister to false when the host is shutting down.

Parameters ​

options? ​
unregister? ​

boolean

Returns ​

void


tick() ​

tick(): void

Defined in: tools/apis/pumpkin-pie-api/src/session.ts:80

Ping and renew registrations when due, with bounded retry backoff.

Returns ​

void

pumpkin-plugins documentation