Click or drag to resize

ServiceDependencies Class

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(Boolean) is called or they can also be configured via environment variables as described in the remarks.
Inheritance Hierarchy
SystemObject
  Neon.ServiceServiceDependencies

Namespace:  Neon.Service
Assembly:  Neon.Service (in Neon.Service.dll) Version: 2.10.0
Syntax
public class ServiceDependencies

The ServiceDependencies type exposes the following members.

Constructors
  NameDescription
Public methodServiceDependencies
Constructor.
Top
Properties
  NameDescription
Public propertyDisableDnsCheck
Use this to disable the DNS availablity check for your service.
Public propertyTimeout
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.
Public propertyUris
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.
Public propertyWait
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.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberDnsCheckHostName
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.
Top
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 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.

See Also