tdl-multiprocess

0.0.2 • Public • Published

tdl-multiprocess

Node.js module tdl crashes when multiple Client instances are used in the same process. The reason behind this is that all client instances are using one instance of underlying tdl library. This package was written to workaround the issue by spawning each Client instance in a dedicated process.

The API is the same as in tdl. It is a drop-in replacement for tdl in your code. However, you still must include tdl module in your own package.json to meet peer dependency.

Example usage

const { Client } = require('tdl-multiprocess')

const client = new Client({
  apiId: 2222, // Your api_id
  apiHash: '0123456789abcdef0123456789abcdef' // Your api_hash
})

await client.connect()
await client.login(() => ({
  type: 'user',
  phoneNumber: '00123456789'
}))

Package Sidebar

Install

npm i tdl-multiprocess

Weekly Downloads

2

Version

0.0.2

License

none

Unpacked Size

7.22 kB

Total Files

4

Last publish

Collaborators

  • dave2dave