XRPL-Labs / xrpl-client

Connect to the XRP Ledger using WebSockets
https://www.npmjs.com/package/xrpl-client
MIT License
12 stars 8 forks source link

connection string determines length of connection #17

Closed shortthefomo closed 8 months ago

shortthefomo commented 8 months ago

Motivation

🚨 WARNING! 🚨 If you are using xrpl-client in a serverless environment, make sure to .close() your connection at the end, to prevent your connection to linger on for a long time (causing massive load on public infrastructure, and massive serverless function invocation time bills from your cloud provider!)

unless a none cluster node is provided in the connection string the lib should auto kill the connection after a period of inactivity or possibly a simple timeout.

this will help move some on to their own infrastructure.

WietseWind commented 8 months ago

@lathanbritz I personally feel the client should do what it is supposed to do: keep a connection.

The infrastructure it connects to should be in charge of closing connections, imo?