-
Notifications
You must be signed in to change notification settings - Fork 29
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
How to originate calls from service #61
Comments
Hey @enp. Hmm I haven't really done this before (it's usually the opposite - originate a call and then use an app to process it). One thing to start with is the quickstart which shows how to manually originate new calls. It's actually a bit of an odd use case since apps are
Note this is all a bit tricky with a Another thing to note is that the Anyway hope this helps. |
Thanks for you response, but I see @event_callback (and maybe @app) is outdated, right? Anyway I need for a bit different. I need for some service with two entry point:
So, I need for some mix of https://aiohttp.readthedocs.io/en/stable/web_quickstart.html#run-a-simple-web-server and https://github.com/friends-of-freeswitch/switchio#use-the-power-of-async-and-await with one event loop for two entry points instead of web.run_app(app) and service.run() What is the best way to do it? |
Hey @enp. Ahh I see you want to create some kind of web service controlled FS service? I personally don't have any experience integrating these two frameworks but I'd imagine it'd require somehow getting either both event loops to run alongside each other or you'd have to figure out how to get one even loop to run coroutines from both frameworks. The event loop management in |
Suppose I already have simple web service with explicit event loop. I need to define switchio EventLoop and Connection both in some |
To start the Actually, @enp if you get this working some docs on how to do it would be greatly appreciated 👍 |
Hmm I guess it would be interesting to see what happens if you tried to use one loop for both. Yeah, we'd have to toy around with allowing passing in an event loop to |
So, it is impossible to use one event loop for both now? Btw, I tried just to import EventListener or EventLoop but I got error:
Why I can't do this? |
No, it just might not work reliably and it's never been tested.
Because If you are having problems unrelated to this original issue please instead join our riot chat. |
@enp ahh I just realized,
Yeah so the internals tutorial is obviously out of date. Like I said docs are in a shambles since the port to I made an issue #62. |
@enp did you have any luck getting this working? |
I've used low-level connection in this way because did not found how to pass event loop into get_client or into get_listener |
@enp oh nice. If you're interested in exposing what you need in some of the higher level APIs we'll gladly take PRs for it! I know that getting this all working with a single loop / thread is definitely possible I just haven't played with it. I've created #66 to track. |
Sure, it will be interesting for me to see higher level example with switchio-specific decorators for event processing and aiohttp-specific decorators for http requests/responses both instead of working with loops manually :) |
Hi,
Is it possible to originate call from my application (I mean my class with @app and @event_callback)?
Maybe anybody can show me simple service based on https://switchio.readthedocs.io/en/latest/services.html which can originate calls in addition to receiving incomimg calls?
The text was updated successfully, but these errors were encountered: