Annotation
This commit is contained in:
parent
11a5549818
commit
58be1ee178
2 changed files with 11 additions and 3 deletions
|
|
@ -8,12 +8,17 @@ public interface IMethod
|
||||||
public abstract static string Method { get; }
|
public abstract static string Method { get; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class Method<TSelf> where TSelf : Method<TSelf>, IMethod
|
[JsonPolymorphic(TypeDiscriminatorPropertyName = "method")]
|
||||||
|
[JsonDerivedType(typeof(InitializeMethod), "initialize")]
|
||||||
|
[JsonDerivedType(typeof(LookupMethod), "lookup")]
|
||||||
|
public abstract class Method
|
||||||
{
|
{
|
||||||
[JsonExtensionData]
|
[JsonExtensionData]
|
||||||
public Dictionary<string, JsonElement> ExtensionData { get; } = [];
|
public Dictionary<string, JsonElement> ExtensionData { get; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public abstract class Method<TSelf> : Method where TSelf : Method<TSelf>, IMethod;
|
||||||
|
|
||||||
public abstract class Method<TSelf, TParam>(TParam parameters) : Method<TSelf> where TSelf : Method<TSelf, TParam>, IMethod
|
public abstract class Method<TSelf, TParam>(TParam parameters) : Method<TSelf> where TSelf : Method<TSelf, TParam>, IMethod
|
||||||
{
|
{
|
||||||
public TParam Parameters => parameters;
|
public TParam Parameters => parameters;
|
||||||
|
|
|
||||||
|
|
@ -38,8 +38,11 @@ public class PowerDnsStreamClient : IDisposable
|
||||||
other.Cancel();
|
other.Cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Task Run(CancellationToken stoppingToken)
|
private async Task Run(CancellationToken stoppingToken)
|
||||||
{
|
{
|
||||||
return Task.CompletedTask;
|
while (!stoppingToken.IsCancellationRequested)
|
||||||
|
{
|
||||||
|
await JsonSerializer.DeserializeAsync<Method>(_stream, cancellationToken: stoppingToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue