# Class InMemorySessionService

An in-memory implementation of the session service.

#### Hierarchy (View Summary)

- BaseSessionService
  - InMemorySessionService

- Defined in sessions/in_memory_session_service.ts:35

## Constructors

### constructor

- new InMemorySessionService(): InMemorySessionService

  #### Returns InMemorySessionService

  Inherited from BaseSessionService.constructor

## Methods

### appendEvent

- appendEvent(request: AppendEventRequest): Promise<Event>

  Appends an event to a session.

  #### Parameters

  - request: AppendEventRequest

    The request to append an event.

  #### Returns Promise<Event>

  A promise that resolves to the event that was appended.

  Overrides BaseSessionService.appendEvent

  - Defined in sessions/in_memory_session_service.ts:173

### createSession

- createSession(request: CreateSessionRequest): Promise<Session>

  Creates a new session.

  #### Parameters

  - request: CreateSessionRequest

    The request to create a session.

  #### Returns Promise<Session>

  A promise that resolves to the newly created session instance.

  Overrides BaseSessionService.createSession

  - Defined in sessions/in_memory_session_service.ts:54

### deleteSession

- deleteSession(request: DeleteSessionRequest): Promise<void>

  Deletes a session.

  #### Parameters

  - request: DeleteSessionRequest

    The request to delete a session.

  #### Returns Promise<void>

  A promise that resolves when the session is deleted.

  Overrides BaseSessionService.deleteSession

  - Defined in sessions/in_memory_session_service.ts:159

### getOrCreateSession

- getOrCreateSession(request: CreateSessionRequest): Promise<Session>

  Gets a session or creates one if it doesn't exist.

  #### Parameters

  - request: CreateSessionRequest

    The request to get or create a session.

  #### Returns Promise<Session>

  A promise that resolves to the session instance.

  Inherited from BaseSessionService.getOrCreateSession

  - Defined in sessions/base_session_service.ts:124

### getSession

- getSession(request: GetSessionRequest): Promise<Session | undefined>

  Gets a session.

  #### Parameters

  - request: GetSessionRequest

    The request to get a session.

  #### Returns Promise<Session | undefined>

  A promise that resolves to the session instance or undefined if not found.

  Overrides BaseSessionService.getSession

  - Defined in sessions/in_memory_session_service.ts:88

### listSessions

- listSessions(request: ListSessionsRequest): Promise<ListSessionsResponse>

  Lists sessions for a user.

  #### Parameters

  - request: ListSessionsRequest

    The request to list sessions.

  #### Returns Promise<ListSessionsResponse>

  A promise that resolves to a list of sessions for the user.

  Overrides BaseSessionService.listSessions

  - Defined in sessions/in_memory_session_service.ts:134