Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

nanomsg-next-generation -- light-weight brokerless messaging

License

NotificationsYou must be signed in to change notification settings

nanomsg/nng

Stand With UkraineLinux StatusWindows StatusmacOS StatusFreeBSD Statusillumos StatusCoverageDiscordManualAsciiDocMIT LicenseLatest Pre-ReleaseLatest Release

Please seehere for an important message for the people of Russia.

Note

This is the development branch for NNG.The content here isunder development and may not be suitable for production use.Please use thestable branchfor the latest stable release.

As a major release, there are some breaking API changes,but amigration guide isavailable to help with migrating from NNG 1.x.

Note

If you are looking for the legacy version of nanomsg, pleasesee thelibnanomsg repository.

This project is a rewrite of the Scalability Protocolslibrary known asnanomsg,and adds significant new capabilities, while retainingcompatibility with the original.

It may help to think of this as "nanomsg-next-generation".

NNG: Lightweight Messaging Library

NNG, like its predecessorsnanomsg (and to some extentZeroMQ), is a lightweight, broker-less library,offering a simple API to solve common recurring messaging problems,such as publish/subscribe, RPC-style request/reply, or service discovery.The API frees the programmer from worrying about details like connectionmanagement, retries, and other common considerations, so that theycan focus on the application instead of the plumbing.

NNG is implemented in C, requiring only a relatively modern C compiler (C11) and CMake to build.It can be built as a shared or a static library, and is readilyembeddable. It is also designed to be easy to port to new platformsif your platform is not already supported.

License

NNG is licensed under a liberal, and commercial friendly, MIT license.The goal to the license is to minimize friction in adoption, use, andcontribution.

Enhancements (Relative to nanomsg)

Here are areas where this project improves on "nanomsg":

  • Reliability

    NNG is designed for production use from the beginning.Every error case is considered, and it is designed to avoid crashing exceptin cases of gross developer error.(Hopefully we don't have any of these in our own code.)

  • Scalability

    NNG scales out to engage multiple cores using a bespoke asynchronous I/Oframework, using thread pools to spread load without exceeding typicalsystem limits.

  • Maintainability

    NNG's architecture is designed to be modular and easily grasped by developersunfamiliar with the code base. The code is also well documented.

  • Extensibility

    Because it avoids ties to file descriptors, and avoids confusing interlockingstate machines, it is easier to add new protocols and transports to NNG.This was demonstrated by the addition of new transports such as TLS.

  • Security

    NNG provides TLS (1.2 and optionally 1.3) enabled transports, offeringsupport for robust and industry standard authentication and encryption.In addition, it is hardened to be resilient against malicious attackers,with special consideration given to use in a hostile Internet.

  • Usability

    NNG eschews slavish adherence parts of the more complex and less wellunderstood POSIX APIs, while adopting the semantics that are familiar anduseful. New APIs are intuitive, and the optional support for separatingprotocol context and state from sockets makes creating concurrentapplications vastly simpler than previously possible.

Compatibility

This project offers both wire compatibility and API compatibility,so most nanomsg users can begin using NNG right away.

Existing nanomsg andmangos applicationscan inter-operate with NNG applications automatically.

That said, there are some areas where legacy nanomsg still offerscapabilities NNG lacks -- specifically enhanced observability withstatistics, and tunable prioritization of different destinationsare missing, but will be added in a future release.

Additionally, some API capabilities that are useful for foreignlanguage bindings are not implemented yet.

Some simple single threaded, synchronous applications may perform better underlegacy nanomsg than under NNG. (We believe that these applications are theleast commonly deployed, and least interesting from a performance perspective.NNG's internal design is slightly less efficient in such scenarios, but itgreatly benefits when concurrency or when multiple sockets or network peersare involved.)

Supported Platforms

NNG supports Linux, macOS, Windows, illumos, Solaris,FreeBSD, Android, and iOS.It is regularly tested against macOS, Windows, OmniOS, Ubuntu, and FreeBSD.Most other POSIX platforms should work out ofthe box but have not been tested. Very old versions of otherwise supportedplatforms might not work.

Officially, NNG only supports operating systems that are supported bytheir vendors. For example, Windows versions 8.1 and lower are no longerofficially supported, and macOS versions predating Ventura are no longerofficially supported. Very old versions of systems may or may not work,and we will generally expend no effort trying to make an unsupported systemfunction.We generally only test relatively recent versions of supported systems.

Requirements

To build this project, you will need a C11 compatible compiler andCMake version 3.15 or newer.

We recommend using theNinja buildsystem (pass-G Ninja to CMake) when you can.(And not just because Ninja sounds like "NNG" -- it's alsoblindingly fast and has made our lives as developers measurably better.)

If you want to build with TLS support you will also need a supportedTLS library. CurrentlyMbed TLS,WolfSSL,andOpenSSL all enjoy some level support in NNG.

See thebuild instructions for details.

Quick Start

With a Linux or UNIX environment:

$ mkdir build$cd build$ cmake -G Ninja ..$ ninja$ ninjatest$ ninja install

Reference Manual

The API documentation is currently in transition, as we are converting it fromAsciidoc tomdbook. Most of the content has now been converted, and you cansee it athere. Part of the conversion includesa substantial reorganization for improved usability, with major content revisionsand additions for NNG 2.0.

The remaining Asciidoc format documentation is in thedocs/man subdirectory, and alsoonline. It will eventually all be converted before 2.0is fully released.

You can also purchase a copy of theNNG Reference Manual.(It is published in both electronic and printed formats.)Purchases of the book help fund continued development of NNG.

Example Programs

Some demonstration programs have been created to help serve as examples.These are located in thedemo directory.

Legacy Compatibility

Migration fromlibnanomsg APIs is fairly straight-forward for most applications.Amigration guide is available to assist.

Commercial Support

Commercial support for NNG is available.

Please contactStaysail Systems, Inc.to inquire further.

Commercial Sponsors

The development of NNG has been made possible through the generoussponsorship ofCapitar IT Group BVandStaysail Systems, Inc..

About

nanomsg-next-generation -- light-weight brokerless messaging

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors89


[8]ページ先頭

©2009-2026 Movatter.jp