mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:46:31 +00:00
fixed inference bugs
add DONE during inference, correct handling on C# side
This commit is contained in:
@@ -6,11 +6,12 @@ namespace Azaion.CommonSecurity;
|
||||
|
||||
public static class ZeroMqExtensions
|
||||
{
|
||||
public static T? Get<T>(this DealerSocket dealer, out byte[] message)
|
||||
public static T? Get<T>(this DealerSocket dealer, Func<byte[], bool>? shouldInterceptFn = null) where T : class
|
||||
{
|
||||
if (!dealer.TryReceiveFrameBytes(TimeSpan.FromMinutes(2), out var bytes))
|
||||
throw new Exception($"Unable to get {typeof(T).Name}");
|
||||
message = bytes;
|
||||
if (shouldInterceptFn != null && shouldInterceptFn(bytes))
|
||||
return null;
|
||||
return MessagePackSerializer.Deserialize<T>(bytes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user