2020-10-05 04:40:38 +00:00
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
|
|
|
|
namespace BirthdayBot.BackgroundServices
|
|
|
|
|
{
|
|
|
|
|
abstract class BackgroundService
|
|
|
|
|
{
|
2020-10-05 04:40:38 +00:00
|
|
|
|
protected ShardInstance ShardInstance { get; }
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2020-10-05 04:40:38 +00:00
|
|
|
|
public BackgroundService(ShardInstance instance) => ShardInstance = instance;
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2020-10-05 04:40:38 +00:00
|
|
|
|
protected void Log(string message) => ShardInstance.Log(GetType().Name, message);
|
2020-04-02 18:27:55 +00:00
|
|
|
|
|
2020-10-05 04:40:38 +00:00
|
|
|
|
public abstract Task OnTick(CancellationToken token);
|
2020-04-02 18:27:55 +00:00
|
|
|
|
}
|
|
|
|
|
}
|