-
Notifications
You must be signed in to change notification settings - Fork 175
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
async calls #11
Comments
Hi Vladimir, Server side async functions are 100% supported. Simply pass in a callback.The tricky part is you must also pass in a 2nd callback for the return value. Here is an example Server: var everyone = require("now").initialize(httpServer);
Client:
|
Very well. Thanks! |
I tried this and it does not seem to work. |
It does work for me. server:
client:
Notice the noop second parameter |
Hi guys, In yesterday's release (v0.3) we have decided to eliminate the necessity of the noop second parameter that dvv has shown. This is because Considering server code:
And client code: In v0.2 you could do this (this is no longer valid in the latest release):
But v0.3 this must be changed to
As you can see this gets rid of the confusing noop callback that you would have to use in v0.2. Originally that was used for return values from the server function, but we found people rarely used return values so we decided to eliminate the confusing element in v0.3 |
Very well. |
0.3: |
@dvv, yes this is a known issue. It's not possible to do nativeFunction.apply(...) as that throws the illegal invocation |
np |
Hi!
How do I manage a client to call a server-side async function (the one that doesn't return the result but instead calls a given callback)?
TIA,
--Vladimir
The text was updated successfully, but these errors were encountered: