当前位置: 首页 > 工具软件 > go-nanomsg > 使用案例 >

理解nanomsg

庄经国
2023-12-01
  • nanomsg

    nanomsg is a socket library that provides several common communication patterns.

    It aims to make the networking layer fast, scalable, and easy to use. Implemented in C, it works on a wide range of operating systems with no further dependencies.

    This project has largely been superceded by the nng project.

  • Communication patterns

    The communication patterns, alse called “scalability protocols”, are basic blocks for building distributed systems.The following scalability protocols are currently acailable:

    • PAIR - simple one-to-one communication
    • BUS - simple many-to-many communication
    • REQREP - alllows to build clusters of stateless services to process user requests
    • PUBSUB - distributes messages to large sets of interested subscribers
    • PIPELINE - aggregates messages from multiple sources and load balances them among many destinations
    • SURVEY - allows to query state of multiple applications in a single go

    Scalability protocols are layered on top of the transport layer in the nerworks stack.The nanomsg library supports the followeing transports mechanisms:

    • INPROC - transport within a process(between threads, modules etc.)
    • IPC - transport between processes on a single machine
    • TCP - network transport via TCP
    • WS - websockets over TCP

    The library exposes a BSD-socket-like C API to the applications.

  • nng Document

    This project is rewrite of the Scalability Protocol library known as libnanomsg, and adds signigicant new caoabilities, while retaining compatibility with the orginal.

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

 类似资料: