tradingview-webhooks-bot icon indicating copy to clipboard operation
tradingview-webhooks-bot copied to clipboard

Wondering if this can handle multiple requests at once?

Open dorienh opened this issue 2 years ago • 3 comments
trafficstars

If I were to send 5 webhooks at the same time (each for different strategies), would I be able to handle them properly?

dorienh avatar May 08 '23 08:05 dorienh

Good question!

It will depend on if the action contains "blocking" functions. i.e. if the action takes a minute to complete, it would take 5 min to complete 5 times.

I could look into making "AsyncActions" which would not be blocking.

Btw, this is all assuming you get 5 actions at once. If you're just talking about 5 strategies that don't all fire at once (and your actions don't take minutes upon minutes to complete) you should be fine! It could theoretically handle unlimited strategies, only limited to how long the actions take to complete.

robswc avatar May 08 '23 13:05 robswc

I'm mostly wondering if any webhook may get lost. Imagine a close short order comes (takes 5s to execute), but the next open long webhook comes 1s later. It's put in some queue?

dorienh avatar May 09 '23 01:05 dorienh

afaik he's saying to adapt the action function to run asynchronously -- then this would not be issue, ever.

devmehta91 avatar Jan 28 '24 21:01 devmehta91