adoptingerlang / service_discovery

Adopting Erlang service discovery project
Apache License 2.0
54 stars 12 forks source link

[question] Is `service_discovery_postgres` application started first? #14

Closed toraritte closed 4 years ago

toraritte commented 4 years ago

rebar.config's relx section starts with

{relx, [{release, {service_discovery, {git, long}},
         [service_discovery_postgres,
          service_discovery,
          service_discovery_http,
          service_discovery_grpc,
          recon]},

and the Releases chapter states that

When constructing the boot script a stable sort on all applications based on their dependencies is done to decide the order to start them. However, when the dependency order is not specific enough to make a decision, the order defined in the list is kept. Each of service_discovery_postgres, service_discovery_http and service_discovery_grpc depend on service_discovery, resulting in the latter being the first to start. The next one will then be service_discovery_postgres because it is listed first.

So the startup/boot order will be (1) service_discovery, (2) service_discovery_postgres, (3) service_discovery_http, (4) service_discovery_grpc and not (1) service_discovery_postgres, (2) service_discovery, (3) service_discovery_http, (4) service_discovery_grpc , or did I completely misunderstood that paragraph?


service_discovery_storage is not listed because it is a library (i.e., collection of modules without any processes), right? So if it would be an external library it would simply go to the deps section in rebar.config?

Thanks in advance!

tsloughter commented 4 years ago

Correct, the startup will be service_discovery first.

service_discovery_storage has to be listed in the .app.src of service_discovery_postgres, but yes, if it was an external library it would also have to be listed as a dep in rebar.config.

toraritte commented 4 years ago

Thank you, especially for the .app.src bit!

Note to self: