ftrackhq / ftrack-javascript

Official ftrack JavaScript API client
Apache License 2.0
6 stars 2 forks source link

Method to explicitly disconnect event hub #238

Closed ffMathy closed 4 months ago

ffMathy commented 4 months ago

Is this possible? We are running out of socket connections in our pre-warmed AWS Lambda.

gismya commented 4 months ago

There is no method on the event hub right now. You should be able to reach it by using eventHub._socketIo.disconnect(), but _socketIo is marked private which means TypeScript will complain. I created a PR to add a proper method for disconnecting.

jimmycallin commented 4 months ago

we also have the autoConnectEventHub option to disable automatic connection, but not sure if that helps you. we'll fix the explicit disconnect method either way

ffMathy commented 4 months ago

Great suggestion, but we are actually manually connecting to the event hub, and that is needed.

gismya commented 4 months ago

A new release with a disconnect() method on eventHub is now out. It's currently not handling pending events in any special way, which could cause issues. Please report if you find any.