NetPro.ZeroMQ 6.0.16

dotnet add package NetPro.ZeroMQ --version 6.0.16
NuGet\Install-Package NetPro.ZeroMQ -Version 6.0.16
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NetPro.ZeroMQ" Version="6.0.16" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetPro.ZeroMQ --version 6.0.16
#r "nuget: NetPro.ZeroMQ, 6.0.16"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install NetPro.ZeroMQ as a Cake Addin
#addin nuget:?package=NetPro.ZeroMQ&version=6.0.16

// Install NetPro.ZeroMQ as a Cake Tool
#tool nuget:?package=NetPro.ZeroMQ&version=6.0.16

NetPro.ZeroMQ使用

NuGet

使用

appsetting.json
  "ZeroMQOption": {
    "PublishPort": 81,
    "PushPort": 82
  }

启用服务

没有基于NetPro.Web.Api 的使用场景,必须手动进行初始化,如下:

IConfiguration Configuration;

public void ConfigureServices(IServiceCollection services)
{
            var option= new ZeroMQOption(configuration);
            services.AddZeroMQForPublisher(option);
            services.AddZeroMQForPushSocket(option);
}

基于NetPro.Web.Api的使用,只需要添加引用后配置以上appsetting.josn配置ZeroMQOption节点即可

使用说明

 public class ZeroMQService: IZeroMQService
    {
        private readonly static object _lock = new();//zeromq socket is thread-unsafe
        private readonly PublisherSocket _publisherSocket;
        private readonly PushSocket _pushSocket;
        public ZeroMQService( PublisherSocket publisherSocket
                , PushSocket pushSocket)
        {
            _publisherSocket = publisherSocket;
            _pushSocket = pushSocket;
        }

        /// <summary>
        /// publish-subscribtion
        /// </summary>
        public void Publish(string sql)
        { 
            lock (_lock)
            {
            _publisherSocket.SendMoreFrame("A:b") // Topic支持特殊符号,topic命名最佳实践:模块名/功能命/功能层级
                   .SendFrame(DateTimeOffset.Now.ToString());
            }
        }

        /// <summary>
        /// push-pull
        /// </summary>
        /// <returns></returns>
        [HttpGet("PushSocket")]
        [ProducesResponseType(200, Type = typeof(ResponseResult))]
        public IActionResult PushSocket()
        {
            lock (_lock)
            {
                //推数据 https://github.com/zeromq/netmq/blob/ea0a5a7e1b77a1ade9311f187f4ff37a20d5d964/src/NetMQ.Tests/PushPullTests.cs
                _pushSocket.SendFrame("Hello Clients"); ;
            }
            return Ok();
        }
    }
更新中...
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.1 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
6.0.16 194 7/24/2023
6.0.15 406 7/19/2022
6.0.14 429 7/10/2022
6.0.13 421 6/15/2022
6.0.12 409 6/15/2022
6.0.11 408 6/15/2022
6.0.10 401 6/11/2022
6.0.9 421 6/8/2022
6.0.8 420 5/26/2022
6.0.8-beta.3 108 5/24/2022
6.0.8-beta.2 110 5/24/2022
6.0.7 412 5/18/2022
6.0.6 400 4/28/2022
6.0.5 425 3/30/2022
6.0.5-beta.20 108 4/27/2022
6.0.5-beta.19 114 4/25/2022
6.0.5-beta.18 113 4/22/2022
6.0.5-beta.17 117 4/16/2022
6.0.5-beta.16 126 4/8/2022
6.0.5-beta.15 119 4/8/2022
6.0.5-beta.14 130 4/7/2022
6.0.5-beta.13 124 4/7/2022
6.0.5-beta.12 124 4/6/2022
6.0.5-beta.11 118 4/6/2022
6.0.5-beta.10 119 3/31/2022
6.0.5-beta.9 133 3/26/2022
6.0.5-beta.8 128 3/22/2022
6.0.5-beta.7 116 3/21/2022
6.0.5-beta.6 117 3/14/2022
6.0.5-beta.5 112 3/2/2022
6.0.5-beta.4 116 2/22/2022