JKang.IpcServiceFramework.Core
1.0.0
See the version list below for details.
dotnet add package JKang.IpcServiceFramework.Core --version 1.0.0
NuGet\Install-Package JKang.IpcServiceFramework.Core -Version 1.0.0
<PackageReference Include="JKang.IpcServiceFramework.Core" Version="1.0.0" />
paket add JKang.IpcServiceFramework.Core --version 1.0.0
#r "nuget: JKang.IpcServiceFramework.Core, 1.0.0"
// Install JKang.IpcServiceFramework.Core as a Cake Addin
#addin nuget:?package=JKang.IpcServiceFramework.Core&version=1.0.0
// Install JKang.IpcServiceFramework.Core as a Cake Tool
#tool nuget:?package=JKang.IpcServiceFramework.Core&version=1.0.0
IpcServiceFramework
A .NET Core lightweight inter-process communication framework allowing invoking a service via named pipeline (in a similar way as WCF, which is currently unavailable for .NET Core).
Support using primitive or complexe types in service contract.
Support multi-threading on server side with configurable number of threads.
ASP.NET Core Dependency Injection framework friendly.
Usage
- Create an interface as service contract and package it in an assembly to be shared between server and client.
- Implement the service and host it in an console or web applciation
- Invoke the service with framework provided proxy client
Sample:
- Service contract
public interface IComputingService
{
float AddFloat(float x, float y);
}
- Service implementation
class ComputingService : IComputingService
{
public float AddFloat(float x, float y)
{
return x + y;
}
}
- Invoke the service from client process
var proxy = new IpcServiceClient<IComputingService>("pipeName");
float result = await proxy.InvokeAsync(x => x.AddFloat(1.23f, 4.56f));
- Host the service (Console application)
class Program
{
static void Main(string[] args)
{
// configure DI
IServiceCollection services = ConfigureServices(new ServiceCollection());
// run IPC service host
IpcServiceHostBuilder
.Buid("pipeName", services.BuildServiceProvider())
.Run();
}
private static IServiceCollection ConfigureServices(IServiceCollection services)
{
return services
.AddIpc(options =>
{
options.ThreadCount = 4;
})
.AddService<IComputingService, ComputingService>();
}
}
- Host the service (Web application)
public class Program
{
public static void Main(string[] args)
{
IWebHost webHost = BuildWebHost(args);
// run the IPC service host in a separated thread because it's blocking
ThreadPool.QueueUserWorkItem(StartIpcService,
webHost.Services.CreateScope().ServiceProvider);
webHost.Run();
}
private static void StartIpcService(object state)
{
var serviceProvider = state as IServiceProvider;
IpcServiceHostBuilder
.Buid("pipeName", serviceProvider as IServiceProvider)
.Run();
}
public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.Build();
}
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddIpc(options =>
{
options.ThreadCount = 4;
})
.AddService<IComputingService, ComputingService>()
;
}
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.Run(async (context) =>
{
await context.Response.WriteAsync("Hello World!");
});
}
}
I'll publish NuGet packages later.
Any contributions or comments are welcome!
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 10.0.3)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on JKang.IpcServiceFramework.Core:
Package | Downloads |
---|---|
JKang.IpcServiceFramework.Client
Package Description |
|
JKang.IpcServiceFramework.Hosting
Package Description |
|
JKang.IpcServiceFramework.Server
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
3.1.0 | 45,430 | 9/12/2020 |
3.1.0-preview.1 | 288 | 9/12/2020 |
3.0.5-preview.1 | 583 | 8/18/2020 |
3.0.4 | 3,339 | 7/5/2020 |
3.0.4-preview.1 | 257 | 7/5/2020 |
3.0.3 | 1,406 | 6/15/2020 |
3.0.3-preview.1 | 240 | 6/15/2020 |
3.0.2 | 1,964 | 6/12/2020 |
3.0.2-preview.2 | 298 | 6/12/2020 |
3.0.2-preview.1 | 299 | 6/12/2020 |
3.0.1 | 1,353 | 6/12/2020 |
3.0.1-ci-20200612.1 | 322 | 6/12/2020 |
3.0.0.34-preview | 708 | 6/12/2020 |
3.0.0.28-alpha | 1,496 | 5/3/2020 |
3.0.0.15-alpha | 725 | 4/28/2020 |
3.0.0.12-alpha | 674 | 4/27/2020 |
3.0.0.10-alpha | 704 | 4/26/2020 |
3.0.0 | 2,066 | 6/12/2020 |
2.3.1 | 13,511 | 12/27/2019 |
2.3.0 | 867 | 12/20/2019 |
2.2.2 | 9,557 | 4/30/2019 |
2.2.1 | 7,729 | 3/28/2019 |
2.2.0 | 4,222 | 12/18/2018 |
2.1.2 | 1,632 | 12/11/2018 |
2.1.1 | 1,097 | 11/20/2018 |
2.1.0 | 1,057 | 11/19/2018 |
2.0.3 | 1,022 | 11/16/2018 |
2.0.2 | 1,056 | 11/14/2018 |
2.0.1.1 | 1,598 | 10/29/2018 |
2.0.0.2 | 1,676 | 7/16/2018 |
1.0.4.3 | 1,243 | 7/13/2018 |
1.0.3 | 1,230 | 6/30/2018 |
1.0.2 | 1,241 | 5/30/2018 |
1.0.1 | 2,844 | 2/14/2018 |
1.0.0 | 1,375 | 1/9/2018 |