priestjim / gen_rpc

A scalable RPC library for Erlang-VM based languages
Apache License 2.0
221 stars 81 forks source link

eval_everywhere & safe_eval_everywhere Preview #23

Closed linearregression closed 8 years ago

linearregression commented 9 years ago

*eval_everywhere Just like rpc's verison apply(Nodes, Module, Function) on the specified nodes. Pure fire and pray. Always return abcast. Nodes is [] or [::node()] eval_everywhere(Nodes, M, F) <-- rpc left this out eval_everywhere(Nodes, M, F, A), eval_everywhere(Nodes, M, F, A, SendTO)

*safe_eval_everywhere (rpc does not have equivalent version) apply(Nodes, Module, Function) on the specified nodes. Returns a list of nodes with status true or {badrpc, Reason} or {badtcp, Reason}. e.g. If SLAVE and SLAVE1 are present to receive messages. Error/Sucess Semantics same as safe_cast. e.g. [{?SLAVE,true}, {?SLAVE1,true},{?FAKE_NODE,{badrpc,nodedown}}] Apply on empty nodes return []. safe_eval_everywhere(Nodes, M, F), safe_eval_everywhere(Nodes,M,F,A), safe_eval_everywhere(Nodes, M, F, A, SendTO)

Note:

Tests:

priestjim commented 9 years ago

Can you please rebase off of develop first?

linearregression commented 9 years ago

Hi, got the chance to check it out yet?

priestjim commented 9 years ago

What you can do is use call to fetch the state from the test gen_server and see if the call has been evaluated. But you need to flush it for every test.

linearregression commented 9 years ago
linearregression commented 8 years ago

done

linearregression commented 8 years ago

please review.