can syn be used only on parts of nodes in cluster
Jokery opened this issue · comments
for example, i have node A_1, A_2, B_1, B_2, and i only run syn on node A_1, A_2, will cause error
Terminating with reason: {badarg,[{erlang,length,[{badrpc,{'EXIT',{undef,[{syn_registry,sync_get_local_registry_tuples,['A_1@127.0.0.1'],[]},{rpc,'-handle_call_call/6-fun-0-',5,[{file,"rpc.erl"},{line,197}]}]}}}],[]},{syn_registry,'-handle_info/2-fun-1-',2,[{file,"src/syn_registry.erl"},{line,237}]},{global,trans,4,[{file,"global.erl"},{line,430}]},{syn_registry,handle_info,2,[{file,"src/syn_registry.erl"},{line,230}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,616}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,686}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]}
Correct, this is by design, Syn automatically manage dynamic clusters and assumes a copy of Syn runs everywhere. This could eventually be modified but I'd need to look into it.
+1 to this feature. In my case I have a diverse cluster where not all nodes have need of global registration.
This has been added in the current v3
rework, which also allows to specify scopes that basically create sub-clusters.
This should cover your use case. Thank you for your input and patience, it will take me still a little while to complete this work.
Syn v3 (which includes this feature through Scopes) is now out.
https://hex.pm/packages/syn