Enable clustered multipart-mime uploads We have to insert a middleman process into the parsing so that each of our copies can retrieve the data as its uploaded.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/95b36a16 Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/95b36a16 Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/95b36a16 Branch: refs/heads/import Commit: 95b36a162ba1e6f3ed5d08e409c9a580cd9f55ef Parents: 0aa7fa9 Author: Paul J. Davis <paul.joseph.da...@gmail.com> Authored: Fri Mar 8 12:43:25 2013 -0600 Committer: Paul J. Davis <paul.joseph.da...@gmail.com> Committed: Fri Jan 17 13:49:15 2014 -0800 ---------------------------------------------------------------------- src/fabric_rpc.erl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/95b36a16/src/fabric_rpc.erl ---------------------------------------------------------------------- diff --git a/src/fabric_rpc.erl b/src/fabric_rpc.erl index ff69f95..f88f035 100644 --- a/src/fabric_rpc.erl +++ b/src/fabric_rpc.erl @@ -483,9 +483,9 @@ make_att_readers([#doc{atts=Atts0} = Doc | Rest]) -> Atts = [Att#att{data=make_att_reader(D)} || #att{data=D} = Att <- Atts0], [Doc#doc{atts = Atts} | make_att_readers(Rest)]. -make_att_reader({follows, Parser}) -> +make_att_reader({follows, Parser, Ref}) -> fun() -> - Ref = case get(mp_parser_ref) of + ParserRef = case get(mp_parser_ref) of undefined -> PRef = erlang:monitor(process, Parser), put(mp_parser_ref, PRef), @@ -493,11 +493,11 @@ make_att_reader({follows, Parser}) -> Else -> Else end, - Parser ! {get_bytes, self()}, + Parser ! {get_bytes, Ref, self()}, receive - {bytes, Bytes} -> + {bytes, Ref, Bytes} -> Bytes; - {'DOWN', Ref, _, _, Reason} -> + {'DOWN', ParserRef, _, _, Reason} -> throw({mp_parser_died, Reason}) end end;