Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Conversation

Internal Conversation implementation. Maintains state for a provided conversation handler to ensure recursive operations remain in-order.

param

the conversation handler to dispatch events to.

Hierarchy

  • Conversation

Index

Constructors

constructor

Properties

Private closed

closed: boolean = false

A flag indicating that the conversation is closed

Private completedExceptionally

completedExceptionally: (cid: ConversationId, conversation: Conversation, e: Error) => void

A callback to call when the conversation completed exceptionally

Type declaration

Private handler

The response handler

Private Optional pendingDiscard

pendingDiscard: any

If defined, the conversation is pending to be discarded and this property contains the reason for discarding it.

Private reserved

reserved: boolean = false

A flag inticating a reserved state to prevent recursive discards

Methods

close

  • close(): void
  • Close the conversation

    Returns void

discard

  • Discard the conversation unless it is already finished.

    Parameters

    • cid: ConversationId

      the conversation ID to discard

    • reason: any

      why the conversation was discarded

    Returns void

Private notifyDiscard

  • Close the conversation and notify the handler

    Parameters

    • cid: ConversationId

      the conversation ID to close

    • reason: any

      why the conversation was closed

    Returns void

open

  • Open the conversation

    Parameters

    Returns void

respond

  • Send a response to the handler.

    Parameters

    Returns Result

    the result code indicating how the response has been handled

Copyright © 2025 DiffusionData Ltd. All Rights Reserved.