> On Dec. 2, 2015, 4:47 p.m., Alexander Rukletsov wrote:
> > src/master/quota_handler.cpp, lines 236-240
> > <https://reviews.apache.org/r/40347/diff/5/?file=1134158#file1134158line236>
> >
> >     Can we re-write it using a lambda? This way you do not need to inject 
> > `authorized` into the continuation.
> >     
> >     ```
> >     authorize(quotaInfo)
> >       .then(defer(master->self(), [=](bool authorized) -> Future<Response> {
> >         if (!authorized) {
> >           return Unauthorized("Mesos master");
> >         }
> >         
> >         _set(quotaInfo);
> >       }));
> >     ```
> 
> Jan Schlicht wrote:
>     Sure, but the rest of the function already has a similar lamdba 
> continuation (i.e. will have after rebasing). This will result in a lambda 
> inside a lambda which is too much nesting IMHO. Therefore I would prefer to 
> keep the continuation.

Oh, sorry, I skipped your example code. Thought that I ought to put everything 
into a lambda and remove the continuation completly. Yes, using the lambda this 
way makes much more sense, will implement it that way.


- Jan


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/40347/#review108645
-----------------------------------------------------------


On Dec. 7, 2015, 2:03 p.m., Jan Schlicht wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/40347/
> -----------------------------------------------------------
> 
> (Updated Dec. 7, 2015, 2:03 p.m.)
> 
> 
> Review request for mesos, Alexander Rukletsov, Alexander Rojas, Joris Van 
> Remoortere, and Till Toenshoff.
> 
> 
> Bugs: MESOS-3862
>     https://issues.apache.org/jira/browse/MESOS-3862
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Quota: Implemented quota request authorization.
> 
> 
> Diffs
> -----
> 
>   src/master/master.hpp 4683fa542a740f9a0b80fff7fbe0e63ec66266f2 
>   src/master/quota_handler.cpp b209da42ace752953686eeda9577007a33556d5d 
> 
> Diff: https://reviews.apache.org/r/40347/diff/
> 
> 
> Testing
> -------
> 
> make check
> 
> 
> Thanks,
> 
> Jan Schlicht
> 
>

Reply via email to