Add client_arc method to return cloned API client#9
Add client_arc method to return cloned API client#9devintrowbridge5905 wants to merge 5 commits intojBernavaPrah:mainfrom
Conversation
Change the return type of the stop function to Result<()>.
jBernavaPrah
left a comment
There was a problem hiding this comment.
Thank you! Hope to have more PRs soon!
|
This weekend I will try to check better why Clippy is complaining. In the meantime, could you tell me how you will use this "client_arc"? |
|
Thanks for the consideration. When I receive a stasis start event, I route the channel to a bridge and spin up a task for that channel that generates internal start/stop talking events based on RTP statistics for the channel. I have a separate long lived thread (i.e. I suppose an alternative would be to setup a second |
AriClientinternally stores the API client asclient: Arc<apis::client::Client>. However, the current accessor is defined as:Because
Arc<T>dereferences toT, this coerces to&Client, preventing callers from moving the client into spawned async tasks. ReturningArc<Client>allows callers to cheaply clone and move the client where needed.Proposed Change