# Obtain settings from provider

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

Settings can be obtained on-demand with [configuration provider](https://vostok.gitbook.io/configuration/concepts-and-basics/configuration-provider)'s **Get** method.

With prior [assignment of sources](https://vostok.gitbook.io/configuration/basic-scenarios/assign-sources-to-types):

```
var settings = provider.Get<MySettings>();
```

With sources passed on per-call basis:

```
var settings = provider.Get<MySettings>(new JsonFileSource("settings.json"));
```

### Get method behavior

* Always returns the most recent version of settings (updates may happen in background):

  * Call **Get** on every settings access for "hot" configuration;
  * Call **Get** once and cache the result for "cold" configuration;

* First call for a type may block or [throw exceptions](https://vostok.gitbook.io/configuration/concepts-and-basics/error-handling) due to source latency, data unavailability or incorrect data format. This behavior persists until a data update remedies the error;

* Once warmed up, subsequent calls never block or throw errors and are extremely cheap due to [caching](https://vostok.gitbook.io/configuration/concepts-and-basics/caching-and-performance). Future errors are not propagated to the calling code, but [can be logged](https://vostok.gitbook.io/configuration/basic-scenarios/log-errors). **Get** calls return the last seen correct settings object;

### Related pages

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

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

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

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