# Constant sources

**Location**: [main sources module](https://vostok.gitbook.io/configuration/modules/sources).

### [ConstantSource](https://github.com/vostok/configuration.sources/blob/master/Vostok.Configuration.Sources/Constant/ConstantSource.cs)

A constant source returns a preconfigured [settings node](https://vostok.gitbook.io/configuration/concepts-and-basics/settings-nodes) and never issues any updates.

```
var source = new ConstantSource(new ValueNode("value"));
```

### [LazyConstantSource](https://github.com/vostok/configuration.sources/blob/master/Vostok.Configuration.Sources/Constant/LazyConstantSource.cs)

A lazy constant source does the same but defers the node acquisition until first subscription:

```
var source = new LazyConstantSource(() => new ValueNode("value"));
```

Errors in the provided delegate are propagated via `(null, error)` notification. It's guaranteed to execute not more than once.

### Practical use

Constant sources are handy for unit testing and may serve as base classes for [custom sources](https://vostok.gitbook.io/configuration/advanced-scenarios/create-custom-sources).

### Related pages

{% content-ref url="../concepts-and-basics/configuration-sources" %}
[configuration-sources](https://vostok.gitbook.io/configuration/concepts-and-basics/configuration-sources)
{% endcontent-ref %}
