Complete refactor, reasync, rebuild listener

This commit is contained in:
Alexander Horner
2022-12-06 22:34:32 +00:00
parent 5a4dfc01b6
commit ed5a43a0e8
8 changed files with 234 additions and 206 deletions

View File

@@ -1,25 +1,30 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace ntfysh_client
{
public class SubscribedTopic
{
public SubscribedTopic(string topicId, string serverUrl, string username, string password, StreamReader stream)
public SubscribedTopic(string topicId, string serverUrl, string? username, string? password, Task runner, CancellationTokenSource runnerCanceller)
{
TopicId = topicId;
ServerUrl = serverUrl;
Username = username;
Password = password;
Stream = stream;
Runner = runner;
RunnerCanceller = runnerCanceller;
}
public string TopicId { get; }
public string ServerUrl { get; }
public string Username { get; }
public string Password { get; }
public string? Username { get; }
public string? Password { get; }
[JsonIgnore]
public StreamReader Stream { get; }
public Task Runner { get; }
[JsonIgnore]
public CancellationTokenSource RunnerCanceller { get; }
}
}