component icon indicating copy to clipboard operation
component copied to clipboard

how do you name components e.g. using via tuples or atom names?

Open shifters67 opened this issue 6 years ago • 4 comments

I understand for global components that you don't give names, but how does that work across nodes e.g. i could use syn/global/horde/swarm and have multiple nodes running my program. In my current case i use syn (very nice it is too) and register the genservers with via tuples, but it is not clear from the readme how naming servers with atoms or via tuples works?

Apologies for the question if its obvious!

shifters67 avatar Jan 14 '19 12:01 shifters67

Components are globally named by default.

Do you think I should also support passing in a tuple, so you can register them using other name registries? On Jan 14, 2019, 6:28 AM -0600, shifters67 [email protected], wrote:

I understand for global components that you don't give names, but how does that work across nodes e.g. i could use syn/global/horde/swarm and have multiple nodes running my program. In my current case i use syn (very nice it is too) and register the genservers with via tuples, but it is not clear from the readme how naming servers with atoms or via tuples works? Apologies for the question if its obvious! — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

pragdave avatar Jan 14 '19 15:01 pragdave

HI Dave,

i think distributed programs still have the same monolithic issues so i think the component library is still just as useful as long as the components can be registered with a via tuple to a suitable distributed registry.

Implemented may be as a parameter field under your 'use' macro???

e.g. registry: {:via, :syn, name} etc

shifters67 avatar Jan 15 '19 12:01 shifters67

i think distributed programs still have the same monolithic issues so i think the component library is still just as useful as long as the components can be registered with a via tuple to a suitable distributed registry. Implemented may be as a parameter field under your 'use' macro???

There’s already a name parameter. If you pass an atom, it gets converted automatically into { :via, :global, name}.

I was suggesting that you could also pass a {:via….} tuple to this option, which would simply be used unchanged.

Would that work?

pragdave avatar Jan 15 '19 20:01 pragdave

Yes that should work fine as that's currently how they are used

shifters67 avatar Jan 16 '19 08:01 shifters67