Juxtapose 1.0.0-dev-013
This is a prerelease version of Juxtapose.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Juxtapose --version 1.0.0-dev-013
NuGet\Install-Package Juxtapose -Version 1.0.0-dev-013
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Juxtapose" Version="1.0.0-dev-013" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Juxtapose --version 1.0.0-dev-013
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Juxtapose, 1.0.0-dev-013"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Juxtapose as a Cake Addin #addin nuget:?package=Juxtapose&version=1.0.0-dev-013&prerelease // Install Juxtapose as a Cake Tool #tool nuget:?package=Juxtapose&version=1.0.0-dev-013&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Juxtapose
1. Intro
基于 SourceGenerator
的硬编码 .Net
多进程
运行库。
2. Features
- 可以为
接口
和静态类
生成代理,无需手动编写RPC相关代码,即可进行多进程
开发; - 编译时生成所有代码,运行时无显式的反射调用和动态构造;
- 支持
委托
和CancellationToken
类型的方法参数(其余类型未特殊处理,将会进行序列化,目前回调委托
不支持嵌套和CancellationToken
); - 支持
Linux
、Windows
(其它未测试);
3. Requirement
- .Net5.0+(其它版本没有尝试过)
4. 使用方法
4.1 引用包
<ItemGroup>
<PackageReference Include="Juxtapose" Version="1.0.*-*" />
<PackageReference Include="Juxtapose.SourceGenerator" Version="1.0.*-*" />
</ItemGroup>
4.2 建立上下文
[IllusionClass(typeof(Greeter), typeof(IGreeter), "Juxtapose.Test.GreeterAsIGreeterIllusion")]
public partial class GreeterJuxtaposeContext : JuxtaposeContext
{
}
示例代码将为Greeter
生成IGreeter
接口的代理类型Juxtapose.Test.GreeterAsIGreeterIllusion
;
Note!!!
- 必须继承
JuxtaposeContext
; - 必须标记
partial
关键字;
4.3 添加入口点
在Main
方法中添加入口点代码,并使用指定上下文
await JuxtaposeEntryPoint.TryAsEndpointAsync(args, GreeterJuxtaposeContext.SharedInstance);
到此已完成开发,创建类型Juxtapose.Test.GreeterAsIGreeterIllusion
的对象,并调用其方法,其实际逻辑将在子进程中运行;
5. 工作逻辑
SourceGenerator
在编译时生成代理类型,封装通信消息。默认使用命名管道进行进程间通信,使用System.Text.Json
进行消息的序列化与反序列化。
参见示例,未完待续......
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net5.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.IO.Pipelines (>= 6.0.0)
-
net6.0
- Microsoft.Extensions.Logging.Abstractions (>= 6.0.0)
- System.IO.Pipelines (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.4.4 | 3,238 | 11/23/2024 |
1.4.3 | 9,739 | 8/10/2024 |
1.4.2 | 5,755 | 6/11/2024 |
1.4.1 | 1,109 | 6/1/2024 |
1.4.0 | 8,246 | 11/21/2023 |
1.3.0 | 319 | 11/15/2023 |
1.2.2 | 27,789 | 12/19/2022 |
1.2.1 | 818 | 10/12/2022 |
1.2.0 | 852 | 10/11/2022 |
1.1.2 | 786 | 9/16/2022 |
1.1.1 | 833 | 7/29/2022 |
1.1.0 | 871 | 7/23/2022 |
1.1.0-beta0001 | 606 | 7/6/2022 |
1.0.2 | 881 | 6/19/2022 |
1.0.1 | 884 | 5/26/2022 |
1.0.0 | 987 | 1/24/2022 |
1.0.0-dev-028 | 547 | 1/24/2022 |
1.0.0-dev-027 | 569 | 1/23/2022 |
1.0.0-dev-026 | 654 | 1/22/2022 |
1.0.0-dev-025 | 594 | 1/18/2022 |
1.0.0-dev-024 | 545 | 1/16/2022 |
1.0.0-dev-023 | 629 | 1/11/2022 |
1.0.0-dev-022 | 662 | 1/5/2022 |
1.0.0-dev-021 | 598 | 12/29/2021 |
1.0.0-dev-020 | 614 | 12/7/2021 |
1.0.0-dev-019 | 572 | 12/7/2021 |
1.0.0-dev-018 | 567 | 12/7/2021 |
1.0.0-dev-017 | 602 | 12/6/2021 |
1.0.0-dev-016 | 563 | 12/5/2021 |
1.0.0-dev-015 | 595 | 12/3/2021 |
1.0.0-dev-014 | 514 | 12/2/2021 |
1.0.0-dev-013 | 608 | 12/2/2021 |
1.0.0-dev-012 | 620 | 12/1/2021 |
1.0.0-dev-011 | 583 | 12/1/2021 |
1.0.0-dev-010 | 541 | 11/30/2021 |