mesos-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joseph Wu <jos...@mesosphere.io>
Subject Re: Review Request 70262: Added a new 'iterable_queue' template to stout.
Date Thu, 21 Mar 2019 20:18:56 GMT

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



So besides changing the callback signature from this:
```
  void received(queue<Event> events)
  {
    while (!events.empty()) {
      Event event = events.front();
      events.pop();
      
      ...
    }
  }
```

To something like this:
```
  void received(iterable_queue<Event> events)
  {
    foreach (const Event event&, events) {
      ...
    }
  }
```

What are the benefits of allowing iteration?  Are there events we expect to receive in batches?
 Or some benefit to looking forward?

- Joseph Wu


On March 21, 2019, 3:57 a.m., Benno Evers wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/70262/
> -----------------------------------------------------------
> 
> (Updated March 21, 2019, 3:57 a.m.)
> 
> 
> Review request for mesos, Benjamin Bannier, Benjamin Mahler, and Joseph Wu.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> This template exposes the iterator interface to a `std::queue`s
> underlying container.
> 
> The motivation for this is so it can be used in the `received()`
> callback of Mesos framework using the v1 API, to allow iterating
> over all received events.
> 
> 
> Diffs
> -----
> 
>   3rdparty/stout/include/stout/iterable_queue.hpp PRE-CREATION 
> 
> 
> Diff: https://reviews.apache.org/r/70262/diff/1/
> 
> 
> Testing
> -------
> 
> Will add a unit test if we have consensus to move forward with adding this.
> 
> 
> Thanks,
> 
> Benno Evers
> 
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message