Learn R Programming

aisdk (version 1.1.0)

ChannelSessionStore: Channel Session Store

Description

Abstract persistence seam for channel-driven sessions.

Arguments

Methods


Method load_session()

Load a persisted ChatSession.

Usage

ChannelSessionStore$load_session(
  session_key,
  tools = NULL,
  hooks = NULL,
  registry = NULL
)

Arguments

session_key

Session key.

tools

Optional tools to reattach.

hooks

Optional hooks to reattach.

registry

Optional provider registry.

Returns

A ChatSession or NULL.


Method save_session()

Save a ChatSession and update store metadata.

Usage

ChannelSessionStore$save_session(session_key, session, record = NULL)

Arguments

session_key

Session key.

session

ChatSession instance.

record

Optional record fields to merge.

Returns

Store-specific save result.


Method update_record()

Update a store record without persisting a session file.

Usage

ChannelSessionStore$update_record(session_key, record)

Arguments

session_key

Session key.

record

Record fields to merge.

Returns

Store-specific update result.


Method get_record()

Retrieve a single session record.

Usage

ChannelSessionStore$get_record(session_key)

Arguments

session_key

Session key.

Returns

Store-specific record object.


Method list_sessions()

List all session records.

Usage

ChannelSessionStore$list_sessions()

Returns

Store-specific collection of session records.


Method has_processed_event()

Check whether an event id has already been processed.

Usage

ChannelSessionStore$has_processed_event(channel_id, event_id)

Arguments

channel_id

Channel identifier.

event_id

Event identifier.

Returns

Logical scalar.


Method mark_processed_event()

Mark an event id as processed.

Usage

ChannelSessionStore$mark_processed_event(channel_id, event_id, payload = NULL)

Arguments

channel_id

Channel identifier.

event_id

Event identifier.

payload

Optional event payload to keep in the dedupe index.

Returns

Store-specific event record.


Arguments

parent_session_key

Parent session key.

child_session_key

Child session key.

Returns

Store-specific link result.


Method clone()

The objects of this class are cloneable with this method.

Usage

ChannelSessionStore$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.