-
Notifications
You must be signed in to change notification settings - Fork 79
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
[Suggestion] If the continue 'Callback' is called last, send it as a response anyway. #12
Comments
@Danappelxx I'll have a look into it! Thanks man! |
The problem with this right now, is that as we rely on the callback in order to make it async, the only way to do that would be to have some kind of timeout for each handler. Thinking a lot about whether the callback thing is worth it vs just returning the request and response at the end of the closure. typealias Handler = (Request, Response) -> (Request, Response) or even typealias Handler = (inout Request, inout Response) -> Void but I'm not very confident with the last one |
The timeout solution seems really dirty to me since it would create a delay if a continue is indeed the last callback, and it would also get in the way if you have a long-running operation. Perhaps you could use promises internally? I know promisekit has a useful method called when that waits for a set of promises to complete and afterwards performs an action. The example they provide is: let search1 = MKLocalSearch(request: rq1).promise()
let search2 = MKLocalSearch(request: rq2).promise()
when(search1, search2).then { response1, response2 in
//...
} I don't think it would be too hard to port it to fit Taylor's needs. |
Alright - if nobody else will I'll play around with this when I can find the time :P |
Basically if I were to have this:
currently, Taylor would return a
not found
page. I propose adding detection which correct the.Continue
to.Send
if its the last one.The text was updated successfully, but these errors were encountered: