Ecosyste.ms: Packages

An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

Top 2.6% on proxy.golang.org
Top 0.8% dependent packages on proxy.golang.org
Top 0.7% dependent repos on proxy.golang.org
Top 5.5% forks on proxy.golang.org
Top 0.4% docker downloads on proxy.golang.org

proxy.golang.org : github.com/libp2p/go-libp2p-gorpc

Package rpc is heavily inspired by Go standard net/rpc package. It aims to do the same thing, except it uses libp2p for communication and provides context support for cancelling operations. A server registers an object, making it visible as a service with the name of the type of the object. After registration, exported methods of the object will be accessible remotely. A server may register multiple objects (services) of different types but it is an error to register multiple objects of the same type. Only methods that satisfy these criteria will be made available for remote access; other methods will be ignored: In effect, the method must look schematically like where T1 and T2 can be marshaled by github.com/ugorji/go/codec. In normal calls, the method's second argument represents the arguments provided by the caller; the third argument represents the result parameters to be returned to the caller. The function error response is passed to the client accordingly. In streaming calls, the method's second and third arguments are argument and replies channels. The method is expected to read from the argument channel until it is closed. The method is expected to send responses on the replies channel and close it when done. Both channels are transparently and asynchronously streamed on the wire between remote hosts. In order to use this package, a ready-to-go libp2p Host must be provided to clients and servers, along with a protocol.ID. rpc will add a stream handler for the given protocol. Contexts are supported and honored when provided. On the server side, methods must take a context. A closure or reset of the libp2p stream will trigger a cancellation of the context received by the functions. On the client side, the user can optionally provide a context. Cancelling the client's context will cancel the operation both on the client and on the server side (by closing the associated stream).

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/libp2p/go-libp2p-gorpc
License: Apache-2.0,MIT
Latest release: 5 months ago
First release: over 5 years ago
Namespace: github.com/libp2p
Dependent packages: 39
Dependent repositories: 71
Stars: 51 on GitHub
Forks: 15 on GitHub
Docker dependents: 17
Docker downloads: 7,047,207
See more repository details: repos.ecosyste.ms
Last synced: 4 days ago

    Loading...
    Readme
    Loading...