- Notifications
You must be signed in to change notification settings - Fork8
Open
Description
We should change the API to make it friendly for standalone instances and not only clusters:
ered:connect(Host, Port, Opts)
for standalone mode, a single connection to a single node.ered:connect_cluster(AddressesAndPorts, Opts)
for cluster.- An ered handle can be represented as a small tuple such as
{cluster, Pid}
. This is similar to how agen_tcp
orssl
handle is represented. - Functions like
ered:command(EredRef, Command)
can work for cluster and standalone and determine by the ered handle (the small tuple) if it's a cluster instance or a single connection.
#41 should be merged first.
Should we autodetect cluster/standalone mode? We could, for example handle an error response form CLUSTER SLOTS. This is not currently the plan though. Users can explicitly connect to a cluster or a standalone node.