Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using tx.Submit in thread #101

Open
tahseenjamal opened this issue Oct 20, 2021 · 2 comments
Open

Using tx.Submit in thread #101

tahseenjamal opened this issue Oct 20, 2021 · 2 comments

Comments

@tahseenjamal
Copy link

Can I use tx.Submit in thread ? I can see in the example_test it is used inside http Handler function

Also if I use tx.Submit in 10 threads, the delivery receipts traffic would increase. Will the Handler function of Transceiver perform fast enough ?

@alexanderomnix
Copy link

I think as stated in the example it uses goroutines, so no problems with that and no performance benefit over calling over threads, the session is managed by the library unless you create multiple connections, some problems you gonna get is a timeout and the disconnections over a large number of submitSM, you should use rate limit and config the window param accordingly.

RateLimiter: rate.NewLimiter(rate.Limit(maxFreqLimiter), 1), // x per second is a good way to control it.

@tahseenjamal
Copy link
Author

@alexanderomnix thanks for replying. I observed that tx.Submit takes 250ms to complete. Which means on a single connect max TPS of 4. And that is the reason, I asked if I can use go routines. Correct me if am wrong here

Yes, I do use rate limit and window parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants