Ecosyste.ms: Packages

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

proxy.golang.org : github.com/weiwenchen2022/chanrpc

Package chanrpc provides access to the exported methods of an object across a chanpipe.Chan. 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 The method's first argument represents the arguments provided by the caller; the second argument represents the result parameters to be returned to the caller. The method's return value, if non-nil, is passed back as a string that the client sees as if created by errors.New. If an error is returned, the reply parameter will not be sent back to the client. The server may handle requests on a single Chan by calling ServeChan. A client wishing to use the service establishes a connection and then invokes NewClient on the connection. The Client object has two methods, Call and Go, that specify the service and method to call, a pointer containing the arguments, and a pointer to receive the result parameters. The Call method waits for the remote call to complete while the Go method launches the call asynchronously and signals completion using the Call structure's Done channel. Here is a simple example. A server wishes to export an object of type Arith: The server calls: At this point, clients can see a service "Arith" with methods "Arith.Multiply" and "Arith.Divide". To invoke one, a client first constructs the Client: Then it can make a remote call: or A server implementation will often provide a simple, type-safe wrapper for the client.

Registry - Source - Documentation - JSON
purl: pkg:golang/github.com/weiwenchen2022/chanrpc
Keywords: go, golang, rpc
License: BSD-3-Clause
Latest release: 10 months ago
First release: 10 months ago
Namespace: github.com/weiwenchen2022
Stars: 0 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 10 days ago

    Loading...
    Readme
    Loading...