Skip to content

Adapters support shutdown callback #218

@yjl9903

Description

@yjl9903

Problem Statement

My adapter needs connect websocket to the remote server. Currently, adapter does not support custom shutdown or disconnect method, so I must manually invoke shutdown method of my adapter after bot.shutdown.

Proposed Solution

  1. Add optional disconnect method to Adapter interface
  2. Invoke all the adapters shutdown method in bot.shutdown

Alternatives Considered

No response

Use Case

// create bot
const bot = new Chat({ /* ... */ })

// do something

// shutdown
bot.shutdown()

// do not manually cleanup
// bot.getAdapter('...').disconnect()

Priority

None

Contribution

  • I am willing to help implement this feature

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions