|
LiveKit C++ Client SDK v1.4.0
Real-time audio/video/data SDK for C++
|
Decorator that adds JWT-aware caching to another configurable token source. More...
#include <token_source.h>


Public Member Functions | |
| std::future< Result< TokenSourceResponse, TokenSourceError > > | fetch (const TokenRequestOptions &options={}) override |
| Fetch connection credentials. | |
| void | invalidate () |
| Clear any cached credentials so the next fetch re-queries the inner source. | |
| std::optional< TokenSourceResponse > | cachedResponse () const |
| Return the currently cached credentials, if any. | |
Static Public Member Functions | |
| static std::unique_ptr< CachingTokenSource > | create (std::unique_ptr< TokenSourceConfigurable > inner) |
Wrap inner with JWT-aware caching. | |
Decorator that adds JWT-aware caching to another configurable token source.
Wrap CustomTokenSource, EndpointTokenSource, or SandboxTokenSource to reduce token fetch calls. A cached response is reused until the request options change or the JWT expires. Call invalidate to force the next fetch to bypass the cache.
| std::optional< TokenSourceResponse > livekit::CachingTokenSource::cachedResponse | ( | ) | const |
Return the currently cached credentials, if any.
std::nullopt when nothing is cached.
|
static |
Wrap inner with JWT-aware caching.
Cached values are keyed by TokenRequestOptions.
| inner | Configurable token source to cache. |
inner responses.
|
overridevirtual |
Fetch connection credentials.
| options | Connection parameters encoded into the token request. |
Implements livekit::TokenSourceConfigurable.