using System.Diagnostics.CodeAnalysis;

namespace TelegramSender;
internal class MessageHub
{
	readonly Queue<string> _messages = [];

	public void Enqueue(string message)
	{
		_messages.Enqueue(message);
	}

	public bool TryDequeue([NotNullWhen(true)] out string? message)
	{
		if (_messages.Count == 0)
		{
			message = null;
			return false;
		}

		message = _messages.Dequeue();
		return true;
	}
}
