> Are you recommending only using function(err, value) pattern for async
operations?

Yes. Think of Callback as a type

`Callback<T>: (err: Error, value: Value) => void`

It has very specific semantics. it takes two arguments, err is either an
Error or falsey, value is anything. A callback get's called EXACTLY once.

> general a callback is an instance of the Observer pattern

ಠ_ಠ <http://disapprovalface.com/>


On Fri, Apr 12, 2013 at 8:10 AM, greelgorke <greelgo...@gmail.com> wrote:

> the term "Callback" in node is very bound to "function will be called
> after async call is done". In general a callback is an instance of the
> Observer pattern, which is in fact a variant of the Delegate pattern. and
> the function you pass to the forEach is in fact a Delegate or you could
> call it Strategy pattern. the difference is in the semantics.
>
> So in node context, callbacks are things called by async functions. bei
> forEach its a delegate, be map it's a transform functions, bei filter, it's
> filter rule etc.
>
> Am Freitag, 12. April 2013 12:21:45 UTC+2 schrieb Tim Oxley:
>
>>
>>
>> On Tuesday, 9 April 2013 23:56:44 UTC-4, Raynos wrote:
>>>
>>> @Eldar, that's an iterator function not a callback. A callback is very
>>> specifically a function (err, value) {} that will not be called
>>> synchronously.
>>>
>>>
>> I've never heard a callback being "very specifically not synchronous"?
>> Are you recommending only using function(err, value) pattern for async
>> operations?
>>
>  --
> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
-- 
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to