title: How to use Pipeline pattern in Delphi
body: <p>I am trying to implement a Pipeline pattern in my test project (<a href="https://stackoverflow.com/questions/39096452/">How to make a Mutlithreded idhttp calls to do work on a StringList</a>), but am having a struggle adapting <code>TThread</code> code to Pipeline pattern code.  There are not many resources about how to use it.</p>
  
  <p>I tried my best below, please DO NOT downvote, I know my code is messy but I'll edit my question if needed.</p>
  
  <pre><code>type
    TForm2 = class(TForm)
      ...
    private
      procedure Retriever(const input: TOmniValue; var output: TOmniValue);
      procedure Inserter(const input, output: IOmniBlockingCollection);
      function HttpGet(url: string; var page: string): boolean;
    end;
  
  procedure TForm2.startButton1Click(Sender: TObject);
  var
    pipeline: IOmniPipeline;
    i       : Integer;
    v       : TOmniValue;
    s       : string;
    urlList : TStringList;
  begin
    pipeline := Parallel.Pipeline;
    pipeline.Stage(Retriever);
    pipeline.Stage(Inserter).NumTasks(10);
    pipeline.Run;
    for s in urlList do
      pipeline.Input.Add(s);
    pipeline.Input.CompleteAdding;
    // wait for pipeline to complete
    pipeline.WaitFor(INFINITE);
  end;
  
  function TForm2.HttpGet(url: string; var page: string): boolean;
  var
    lHTTP: TIdHTTP;
    i : integer;
    X : Tstrings;
    S,M,fPath : String;
  begin
    lHTTP := TIdHTTP.Create(nil);
    X := TStringList.Create;
    try
      X.Text := lHTTP.Get('https://instagram.com/'+fPath);
      S:= ExtractDelimitedString(X.Text);
      X.Clear;
      Memo2.Lines.Add(fPath+ ' :     '+ M ); //how to pass the result to Inserter
    finally
      lHttp.Free;
    end;
  end;
  
  procedure TForm2.Inserter(const input, output: IOmniBlockingCollection);
  var
    result   : TOmniValue;
    lpage     : string;
  begin
    for result in input do begin
      Memo2.Lines.Add(lpage);
      FreeAndNil(lpage);
    end;
    // correect?
  end;
  
  procedure TForm2.Retriever(const input: TOmniValue; var output: TOmniValue);
  var
    pageContents: string;
  begin
    if HttpGet(input.AsString, pageContents) then
      output := //???
  end;
  </code></pre>