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

Only allow sending one blocking api command at a time. #7

Open
pragmatrix opened this issue Jun 1, 2023 · 0 comments
Open

Only allow sending one blocking api command at a time. #7

pragmatrix opened this issue Jun 1, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@pragmatrix
Copy link
Member

FreeSWITCH documentation states at https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Modules/mod_event_socket_1048924/#31-api:

Send a FreeSWITCH API command, blocking mode. That is, the FreeSWITCH instance won't accept any new commands until the api command finished execution.

free-socks currently supports sending multiple blocking and - perhaps soon - other commands by letting clients clone the Client instance. Preventing the clone would not solve the problem, because async functions can be used as futures and initiated concurrently as long &self is used. An alternative would be to prevent cloning by using &mut self, schedule blocking commands, or detect the race condition and return an error?

And what about events, can they be received in between?

@pragmatrix pragmatrix added the bug Something isn't working label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant