session_lifecycle.c File
A local app that follows its session through a hub's new session, a join to another hub, and a reset that requires onboarding again. More...
Included Headers
Classes Index
| struct | LifecycleMailbox |
|
[lifecycle_callback] More... | |
Typedefs Index
| typedef | struct LifecycleMailbox LifecycleMailbox |
|
[lifecycle_callback] More... | |
Functions Index
| static const char * | cause_name (QarSessionChangeCause cause) |
| static bool | get_or_create_owned_objects (QarSession *session) |
|
Get or create what this app owns in the session: here one app volume. Idempotent: the same id every time; an existing volume is taken over and carried into the hub's next session, a missing one is created. Called on every start, on every new session id and after onboarding again. More... | |
| int | main (int argc, char **argv) |
| static void | on_lifecycle (const QarSessionLifecycleInfo *info, void *user_state) |
| static void | print_session_id (const char *label, const QarSessionId *id) |
| static bool | start_session (QarRuntime *runtime, LifecycleMailbox *mailbox, QarSession **out_session, QarCancelToken **out_token, QarSessionId *out_seen_id) |
|
[lifecycle_subscribe] More... | |
| static const char * | state_name (QarSessionLifecycleState state) |
|
[lifecycle_callback] More... | |
| static void | stop_session (QarSession *session, QarCancelToken *token, LifecycleMailbox *mailbox) |
|
End the subscription before the session: the token waits for a running callback, so no callback touches the mailbox afterwards. A state the old session delivered since main last looked is dropped with it. More... | |
| static QarCancelToken * | subscribe_lifecycle (QarSession *session, LifecycleMailbox *mailbox) |
|
[lifecycle_subscribe] More... | |
Macro Definitions Index
| #define | APP_TAG "main.session-lifecycle.examples.quaternar" |
Description
A local app that follows its session through a hub's new session, a join to another hub, and a reset that requires onboarding again.
Typedefs
LifecycleMailbox
|
[lifecycle_callback]
The newest lifecycle state, handed from the library thread to main.
Definition at line 94 of file session_lifecycle.c.
Functions
cause_name()
| static |
Definition at line 128 of file session_lifecycle.c.
get_or_create_owned_objects()
| static |
Get or create what this app owns in the session: here one app volume. Idempotent: the same id every time; an existing volume is taken over and carried into the hub's next session, a missing one is created. Called on every start, on every new session id and after onboarding again.
Definition at line 160 of file session_lifecycle.c.
main()
|
Definition at line 258 of file session_lifecycle.c.
on_lifecycle()
| static |
Definition at line 97 of file session_lifecycle.c.
print_session_id()
| static |
Definition at line 142 of file session_lifecycle.c.
start_session()
| static |
[lifecycle_subscribe]
Join as a local app, create what the app owns and subscribe. Returns false, with nothing left open, on failure.
Definition at line 205 of file session_lifecycle.c.
state_name()
| static |
[lifecycle_callback]
Definition at line 112 of file session_lifecycle.c.
stop_session()
| static |
End the subscription before the session: the token waits for a running callback, so no callback touches the mailbox afterwards. A state the old session delivered since main last looked is dropped with it.
Definition at line 250 of file session_lifecycle.c.
subscribe_lifecycle()
| static |
[lifecycle_subscribe]
Subscribe to the session's lifecycle. Returns the token owning the subscription, or NULL on failure.
Definition at line 182 of file session_lifecycle.c.
Macro Definitions
APP_TAG
|
Definition at line 84 of file session_lifecycle.c.
File Listing
The file content with the documentation metadata removed is:
Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.9.8.