Commit 0964862b authored by Philip Pronin's avatar Philip Pronin Committed by Facebook Github Bot

make parallel generator movable

Summary:
If `Source` isn't copyable, parallel generator cannot be composed
further due to implicitly deleted move ctor.

Example:

```
byLines(File(...))
| parallel(map(...))
| sum;
```

Reviewed By: ddrcoder, ot

Differential Revision: D10004477

fbshipit-source-id: 51ce23e834413bd53547a683f8ed89a1811f74a2
parent 4ca1b685
...@@ -172,11 +172,12 @@ class Parallel : public Operator<Parallel<Ops>> { ...@@ -172,11 +172,12 @@ class Parallel : public Operator<Parallel<Ops>> {
Composed, Composed,
Output, Output,
OutputDecayed>> { OutputDecayed>> {
const Source source_; Source source_;
const Ops ops_; Ops ops_;
const size_t threads_; size_t threads_;
typedef ClosableMPMCQueue<InputDecayed> InQueue;
typedef ClosableMPMCQueue<OutputDecayed> OutQueue; using InQueue = ClosableMPMCQueue<InputDecayed>;
using OutQueue = ClosableMPMCQueue<OutputDecayed>;
class Puller : public GenImpl<InputDecayed&&, Puller> { class Puller : public GenImpl<InputDecayed&&, Puller> {
InQueue* queue_; InQueue* queue_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment