couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Davis <paul.joseph.da...@gmail.com>
Subject Re: Erlang views
Date Fri, 20 Nov 2009 11:38:05 GMT
On Thu, Nov 19, 2009 at 6:15 PM, Michael McCaffrey
<mmccaffrey@ittvis.com> wrote:
> Playing around with erlang views and I'm trying to spawn the Emit.
>
>
>
> I see the Emit is defined in couch_native_process but can't get the
> spawn to work.
>
>
>
> Tried spawn(erlang, Emit,["A',"B"]),  spawn(couch_native_process, Emit,
> ["A","B"]), etc.
>
>
>
> Get errors like this.
>
>   {badarg,
>
>       [{erlang,spawn,
>
>            [erlang,
>
>             #Fun<couch_native_process.5.68659142>,
>
>             [<<"A">>,<<"B">>]]},
>
>
>
> Anyone know the proper syntax?
>
>
>
> Thanks
>
>

You really shouldn't be spawning here. Unless you pull some acrobatics
to make sure and block the function and wait for all spawns to return,
the function calling your views is not setup to expect asynchronous
results. view functions are expected to behave like functions that are
passed to lists:fold etc.

HTH,
Paul Davis

Mime
View raw message