You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by 王国栋 <wa...@gmail.com> on 2013/07/18 11:56:38 UTC

What does the different between "defer" and "delay" ?

Hey guys,

I am trying to understand the logic of libprocess.

In my mind, delay means that we can schedule an specific callback in the
future.
But I am confused about the meaning of "defer".

Could you please explain the meaning of defer ? I can see a lot of "defer"
are used to add OnAny callbacks. Why not use the tr1:bind or tr1:function
directly?

Many Thanks.


Guodong

Re: What does the different between "defer" and "delay" ?

Posted by 王国栋 <wa...@gmail.com>.
Hi Ben,

This makes sense to me now. I didn't see the comment in defer.hpp
yesterday. Now, it is quite clear to me.

Thanks for your help.

Guodong


On Fri, Jul 19, 2013 at 8:42 AM, Benjamin Mahler
<be...@gmail.com>wrote:

> Hey Guodong,
>
> Have you seen the comments on defer.hpp?
>
> // The defer mechanism is very similar to the dispatch mechanism (see
> // dispatch.hpp), however, rather than scheduling the method to get
> // invoked, the defer mechanism returns a 'Deferred' object that when
> // invoked does the underlying dispatch.
>
> Make sense? Let me know if you need more explanation.
>
> On Thu, Jul 18, 2013 at 2:56 AM, 王国栋 <wa...@gmail.com> wrote:
>
> > Hey guys,
> >
> > I am trying to understand the logic of libprocess.
> >
> > In my mind, delay means that we can schedule an specific callback in the
> > future.
> > But I am confused about the meaning of "defer".
> >
> > Could you please explain the meaning of defer ? I can see a lot of
> "defer"
> > are used to add OnAny callbacks. Why not use the tr1:bind or tr1:function
> > directly?
> >
> > Many Thanks.
> >
> >
> > Guodong
> >
>

Re: What does the different between "defer" and "delay" ?

Posted by Benjamin Mahler <be...@gmail.com>.
Hey Guodong,

Have you seen the comments on defer.hpp?

// The defer mechanism is very similar to the dispatch mechanism (see
// dispatch.hpp), however, rather than scheduling the method to get
// invoked, the defer mechanism returns a 'Deferred' object that when
// invoked does the underlying dispatch.

Make sense? Let me know if you need more explanation.

On Thu, Jul 18, 2013 at 2:56 AM, 王国栋 <wa...@gmail.com> wrote:

> Hey guys,
>
> I am trying to understand the logic of libprocess.
>
> In my mind, delay means that we can schedule an specific callback in the
> future.
> But I am confused about the meaning of "defer".
>
> Could you please explain the meaning of defer ? I can see a lot of "defer"
> are used to add OnAny callbacks. Why not use the tr1:bind or tr1:function
> directly?
>
> Many Thanks.
>
>
> Guodong
>