Can you use wait for in a server filter? Because if I do it like described here in the tutorial, I have no possibility to return in the "filter" sub?
Resumable Subs (wait for / sleep) in server handlers
Resumable subs can only work when there is a message queue. By default, server handlers end when the Handle sub is completed. They do not create a message loop. If you want to wait for an event then you need to call StartMessageLoop and later StopMessageLoop. Example of handler that downloads...
www.b4x.com
B4X:
Public Sub Filter(req As ServletRequest, resp As ServletResponse)
VerifyToken(req.GetHeader("Authorization"),req) 'Return?
StartMessageLoop
End Sub
Private Sub VerifyToken(auth_token As String,req As ServletRequest) As ResumableSub
fs.VerifyToken(auth_token)
Wait For fs_TokenVerified(TokenId As String, Success As Boolean, Token As FirebaseToken)
Return Success
End sub