/
aprogrammer
/
reverse-proxy-ms-yarp
Обзор
Документация
Войти
/
aprogrammer
/
reverse-proxy-ms-yarp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Kubernetes.Controller/Hosting/HostedServiceAdapter.cs
28 строк
1 KB
David Bevin
Tidied up namespaces for Kubernetes projects (#1717)
27 май 2022, 18:52
Не верифицирован
27 май 2022, 18:52
2fa9c3b
Код
Авторство
О чём код?
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. using Microsoft.Extensions.Hosting; using System.Threading; using System.Threading.Tasks; namespace Yarp.Kubernetes.Controller.Hosting; /// <summary> /// Delegates start and stop calls to service-specific interface. /// </summary> /// <typeparam name="TService">The service interface to delegate onto.</typeparam> public class HostedServiceAdapter<TService> : IHostedService where TService : IHostedService { private readonly TService _service; /// <summary> /// Initializes a new instance of the <see cref="HostedServiceAdapter{TInterface}" /> class. /// </summary> /// <param name="service">The service interface to delegate onto.</param> public HostedServiceAdapter(TService service) => _service = service; public Task StartAsync(CancellationToken cancellationToken) => _service.StartAsync(cancellationToken); public Task StopAsync(CancellationToken cancellationToken) => _service.StopAsync(cancellationToken); }