TomatenMusic-V2/TomatenMusic/Services/EventBus.cs

27 lines
633 B
C#
Raw Normal View History

2022-03-19 22:28:54 +01:00
using DSharpPlus.Entities;
using Emzi0767.Utilities;
using Microsoft.AspNetCore.Mvc;
using TomatenMusic_Api.Models;
2022-03-22 20:00:33 +01:00
using TomatenMusic_Api.Models.EventArgs;
2022-03-19 22:28:54 +01:00
namespace TomatenMusic_Api;
public class InProcessEventBus
{
2022-03-22 20:00:33 +01:00
public event AsyncEventHandler<InProcessEventBus, ChannelConnectArgs>? OnConnectRequest;
2022-03-19 22:28:54 +01:00
2022-03-22 20:00:33 +01:00
public event AsyncEventHandler<InProcessEventBus, ChannelDisconnectArgs>? OnDisconnectRequest;
public void OnConnectRequestEvent(ChannelConnectArgs e)
2022-03-19 22:28:54 +01:00
{
_ = OnConnectRequest?.Invoke(this, e);
}
2022-03-22 20:00:33 +01:00
public void OnDisconnectRequestEvent(ChannelDisconnectArgs e)
{
_ = OnDisconnectRequest?.Invoke(this, e);
2022-03-19 22:28:54 +01:00
}
}