Class ServiceDependencies
Used to specify other services that must be reachable via the network before a NeonService will be allowed to start. This is exposed via the Dependencies where these values can be configured in code before RunAsync(bool) is called or they can also be configured via environment variables as described in the remarks.
Namespace: Neon.Service
Assembly: Neon.Service.dll
Syntax
public class ServiceDependencies
Remarks
This class will be initialized using the following environment variables when present:
NEON_SERVICE_DEPENDENCIES_URIS=http://foo.com;tcp://10.0.0.55:1234
NEON_SERVICE_DEPENDENCIES_DISABLE_DNS_CHECK=false
NEON_SERVICE_DEPENDENCIES_TIMEOUT_SECONDS=30
NEON_SERVICE_DEPENDENCIES_WAIT_SECONDS=5
Where you can specify multiple dependency URIs separated by semicolons (;) and the timeout and wait times as seconds.
note
Only HTTP, HTTPS, and TCP URIs are supported.
We also verify that your service is able to perform DNS queries by default by performing a DNS name lookup for DnsCheckHostName (net-check.neoncloud.io). It doesn't matter that this host name is actually registered or that you're cluster has Internet access. We're just looking for any response from the upstream DNS server to determine whether the service has and network connectivity.
You can disable this by setting DisableDnsChecktrue or
the NEON_SERVICE_DEPENDENCIES_DISABLE_DNS_CHECK
environment variable to
false
.
Constructors
ServiceDependencies()
Constructor.
Declaration
public ServiceDependencies()
Fields
DnsCheckHostName
The host name used for the DNS availablity check. It doesn't matter that this host name is actually registered or that you're cluster has Internet access. We're just looking for any response from the upstream DNS server.
Declaration
public const string DnsCheckHostName = "net-check.neoncloud.io"
Field Value
Type | Description |
---|---|
string |
Properties
DisableDnsCheck
Use this to disable the DNS availablity check for your service.
Declaration
public bool DisableDnsCheck { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
We also verify that your service is able to perform DNS queries by default by performing a DNS name lookup for DnsCheckHostName (net-check.neoncloud.io). It doesn't matter that this host name is actually registered or that you're cluster has Internet access. We're just looking for any response from the upstream DNS server to determine whether the service has and network connectivity.
You can disable this by setting DisableDnsChecktrue or
the NEON_SERVICE_DEPENDENCIES_DISABLE_DNS_CHECK
environment variable to
false
.
Timeout
The maximum time to wait for the services specified by Uris to
be reachable. You service will be terminated if this is exceeded. This
defaults to 120 seconds or the NEON_SERVICE_DEPENDENCIES_TIMEOUT_SECONDS
environment variable.
Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Uris
Specifies the URIs for external services that must be reachable via the network
before your service will be allowed to start. Only HTTP, HTTPS, and TCP URIs
are supported. Any URIs found in the NEON_SERVICE_DEPENDENCIES_URIS
environment variables will be added to this list.
Declaration
public List<Uri> Uris { get; set; }
Property Value
Type | Description |
---|---|
List<Uri> |
Wait
Additional time to wait after the services specified by Uris are
ready before the service will be started. This defaults to 0 seconds
or the NEON_SERVICE_DEPENDENCIES_WAIT_SECONDS
environment variable.
Declaration
public TimeSpan Wait { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |