anchor.diff:              drop_list(Next, Size - 1)
       end.
   
  -consumer(S2, Size, F) ->
  +consumer(S2, Size, F, Output) ->
       case Size of
           0 ->
               ok;
           _ ->
               case derflow:consume(S2) of
                   {ok, nil, _} ->
  -                    ok;
  -                {ok, _Value, Next} ->
  -                    consumer(Next, Size - 1, F)
  +                    derflow:bind(Output, nil);
  +                {ok, Value, Next} ->
  +                    {ok, NextOutput} = derflow:produce(Output, F(Value)),
  +                    consumer(Next, Size - 1, F, NextOutput)
               end
       end.
  
positive.code:     lager:info("Remote code loading complete."),
  
      lager:info("Remotely executing the test."),
      rpc:call(Node, ?MODULE, test, []),
  
      %% It's possible this test is written incorrectly, given the
      %% consumer function takes a function which is supposed to double
      %% values and never returns anything.
      fail.
  
  -endif.
  
  test() ->
      {ok, S1} = derflow:declare(),
      spawn(derflow_bounded_buffer_test, producer, [0, 10, S1]),
      {ok, S2} = derflow:declare(),
      spawn(derflow_bounded_buffer_test, buffer, [S1, 2, S2]),
      consumer(S2, 5, fun(X) -> X*2 end),
      derflow:get_stream(S2).
  
  producer(Value, N, Output) ->
      if
  
negative.code: -export([test/0,
           buffer/3,
           producer/3,
           consumer/4]).
  
  -ifdef(TEST).
  
  