TomatenMusic-V2/TomatenMusic/Services/EventBus.cs
2022-03-22 20:00:33 +01:00

27 lines
633 B
C#

using DSharpPlus.Entities;
using Emzi0767.Utilities;
using Microsoft.AspNetCore.Mvc;
using TomatenMusic_Api.Models;
using TomatenMusic_Api.Models.EventArgs;
namespace TomatenMusic_Api;
public class InProcessEventBus
{
public event AsyncEventHandler<InProcessEventBus, ChannelConnectArgs>? OnConnectRequest;
public event AsyncEventHandler<InProcessEventBus, ChannelDisconnectArgs>? OnDisconnectRequest;
public void OnConnectRequestEvent(ChannelConnectArgs e)
{
_ = OnConnectRequest?.Invoke(this, e);
}
public void OnDisconnectRequestEvent(ChannelDisconnectArgs e)
{
_ = OnDisconnectRequest?.Invoke(this, e);
}
}