I am passing a callback. There's no difference between our code.

I narrowed the problem down to what goes on in login.login with the restler 
function. Basically, the callback is executed on POST - nothing waits for 
'data' to be received. However, I don't know how to code that down.

W dniu wtorek, 26 czerwca 2012 12:37:10 UTC+2 użytkownik Oleg Efimov 
(Sannis) napisał:
>
> You should pass a callback, not call it:  http://jsfiddle.net/LW5w3/1/ 
>
> вторник, 26 июня 2012 г., 13:41:21 UTC+4 пользователь trewebs написал:
>>
>> Right, so I did this: http://jsfiddle.net/Eu574/7/ 
>> passed callback as last argument into login.login and set it to execute 
>> on database connection complete.. but it doesn't work.
>>
>> W dniu wtorek, 26 czerwca 2012 10:27:31 UTC+2 użytkownik Boris Egorov 
>> napisał:
>>>
>>> Is your login.login function could take a callback? Source of your 
>>> problem is pretty obvious - you invoke callback(null, "one") before db 
>>> connected.
>>> You should pass callback function to login as an argument and call it 
>>> when db connection established.
>>> ---------
>>> Boris Egorov
>>> skype/gtalk/nickname: dolphin278
>>> mobile: +7 905 728 1543
>>>
>>>
>>> On Tue, Jun 26, 2012 at 12:23 PM, trewebs <[email protected]> wrote:
>>>
>>>> Hi, I have a problem with running functions in sync: 
>>>> http://jsfiddle.net/Eu574/3/
>>>> The problem is defined in the fiddle.
>>>> Please tell me what you think.
>>>>  
>>>> -- 
>>>> Job Board: http://jobs.nodejs.org/
>>>> Posting guidelines: 
>>>> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
>>>> You received this message because you are subscribed to the Google
>>>> Groups "nodejs" group.
>>>> To post to this group, send email to [email protected]
>>>> To unsubscribe from this group, send email to
>>>> [email protected]
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/nodejs?hl=en?hl=en
>>>>
>>>
>>>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to