Skip to content

A simple and fast contractless RPC library for .NET and .NET Core

Notifications You must be signed in to change notification settings

pelmenin/SimpleRpc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleRpc

Build status License NuGet NuGet

A simple and fast contractless RPC library for .NET and .NET Core, over IServiceCollection (you can use any supported DI container)

Quick Start

For .NET 4.6+, NET Standard 2 (.NET Core) available in NuGet

Install-Package SimpleRpc

Client

var sc = new ServiceCollection();

sc.AddSimpleRpcClient("sample", new HttpClientTransportOptions
{
    Url = "http://127.0.0.1:5000/rpc"                
});

sc.AddSimpleRpcProxy<IFooService>("sample");
// or
sc.AddSimpleRpcProxy(typeof(IFooService), "sample");

var pr = sc.BuildServiceProvider();

var service = pr.GetService<IFooService>();

service.Plus(1,5);

Server

In your Startup class...

public void ConfigureServices(IServiceCollection services)
{
    services.AddSimpleRpcServer(new HttpServerTransportOptions {Path = "/rpc"});

    services.AddSingleton<IFooService, FooServiceImpl>();
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    app.UseSimpleRpcServer();
}

Sample Projects

Samples contains examples for using of SimpleRpc

Serializers

Default serializer can be changed in Serializer property, for example

sc.AddSimpleRpcClient("sample", new HttpClientTransportOptions
{
    Url = "http://127.0.0.1:5000/rpc",
    Serializer = "wire"
});
Serializer Name (for client options)
MessagePack (lz4 compression) msgpack
Wire (lz4 compression) wire

About

A simple and fast contractless RPC library for .NET and .NET Core

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%