<commit_before>﻿AsyncInit Unity Dependency Injection
====================================

AsyncInit Unity dependency injection.

Usage
-----

0. Install `Ditto.AsyncInit.Unity`:

        Install-Package Ditto.AsyncInit.Unity

1. Define the interface:

        interface IUniversalAnswerService
        {
            int Answer { get; }
        }

2. Implement it, deriving from an appopriate `AsyncInitBase` or `CancelableAsyncInitBase` _(recommended)_:

        using Ditto.AsyncInit;

        class UniversalAnswerService : CancelableAsyncInitBase<UniversalAnswerService>, IUniversalAnswerService
        {
            private UniversalAnswerService()
                : base(null)
            {
            }

            protected override async Task InitAsync(CancellationToken cancellationToken)
            {
                await Task.Delay(TimeSpan.FromDays(7500000 * 365.25), cancellationToken);
                Answer = 42;<commit_msg>Updated description<commit_after>﻿AsyncInit Unity Dependency Injection
====================================

Adds support for asynchronously initialized types to Unity Container.

Usage
-----

0. Install `Ditto.AsyncInit.Unity`:

        Install-Package Ditto.AsyncInit.Unity

1. Define the interface:

        interface IUniversalAnswerService
        {
            int Answer { get; }
        }

2. Implement it, deriving from an appopriate `AsyncInitBase` or `CancelableAsyncInitBase` _(recommended)_:

        using Ditto.AsyncInit;

        class UniversalAnswerService : CancelableAsyncInitBase<UniversalAnswerService>, IUniversalAnswerService
        {
            private UniversalAnswerService()
                : base(null)
            {
            }

            protected override async Task InitAsync(CancellationToken cancellationToken)
            {
                await Task.Delay(TimeSpan.FromDays(7500000 * 365.25), cancellationToken);
                Answer = 42;
{'fraction_non_alphanumeric': 0.10362694300518134, 'fraction_numerical': 0.017616580310880828, 'mean_word_length': 2.50453720508167, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2067039', 'n_tokens_mistral': 521, 'n_tokens_neox': 452, 'n_words': 115}