Squirrowse/Squirrowse.Client/Worker.cs
2019-11-06 11:49:39 +01:00

35 lines
1008 B
C#

using System;
using System.Drawing;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using OpenCvSharp;
using Squirrowse.Client.Service;
namespace Squirrowse.Client
{
public class Worker : IHostedService
{
private readonly ILogger<Worker> logger;
private readonly IConnectionManager _connectionManager;
private readonly ICameraService camera;
public Worker(ILogger<Worker> logger, IConnectionManager connectionManager, ICameraService camera)
{
this.logger = logger;
this._connectionManager = connectionManager;
this.camera = camera;
}
public async Task StartAsync(CancellationToken cancellationToken)
{
await _connectionManager.InitConnection();
}
public async Task StopAsync(CancellationToken cancellationToken)
{
await _connectionManager.Disconnect();
}
}
}