-
Notifications
You must be signed in to change notification settings - Fork 130
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
Asynchronous response in respond
#74
Comments
@jfgrang Unfortunately Telegraph doesn't support asynchronous responses at this moment. You might be able to implement it by creating your own It would be great if we could support a closure return type in a handler, but that requires some refactoring. Maybe next weekend I'll be able to make some updates to the framework. Add a Package.swift and things like that. |
hello @yvbeek , is there any news about this subject? i would like to intercept and execute some requests to a distant server before returning an HTTPResponse, but i don't see anything to do that. Am i wrong? |
@tlemansec Sorry for my late reply. Adding Swift Package Manager support and fixing the iOS 13 issue were way more difficult than I anticipated. After this release I'll have a look at async reponses. |
Version 0.28 is now available 🚀 To support asynchronous requests / responses I'm going to have to make some changes to the Server, Route and Handler classes. The most difficult part is the request handler chain, I have to somehow make that asynchronous. I hope to have some time next weekend to work on it. |
@jfgrang I solved by using a
|
It looks like this thread has gone quiet but are there any updates on supporting this in Telegraph without having to work-around and use Dispatch Groups? |
@paultiarks Unfortunately it is going to take quite a bit of (re)architecture and dev work to add this to the library. As I no longer use Telegraph in my day-to-day work, it might take a while for me to look into this. The DispatchGroup can be a workaround for now and should probably scale well enough for Telegraph's use cases. I'm also happy to look into PRs if there are people who have implemented this feature. |
I am looking for a way to make
respond
asynchronous.In some cases I don't have a local file and I want to download it then deliver it.
The given example seems to only manage local synchronous requests. How would you perform a network download in that
nextHandler
chain ?I was considering to add a
waitHandler
that checks the status of a Session but it seems a little odd.Thanks for your help
The text was updated successfully, but these errors were encountered: