IceRpc.Slice 0.3.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package IceRpc.Slice --version 0.3.0
NuGet\Install-Package IceRpc.Slice -Version 0.3.0
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="IceRpc.Slice" Version="0.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IceRpc.Slice --version 0.3.0
#r "nuget: IceRpc.Slice, 0.3.0"
#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 IceRpc.Slice as a Cake Addin
#addin nuget:?package=IceRpc.Slice&version=0.3.0

// Install IceRpc.Slice as a Cake Tool
#tool nuget:?package=IceRpc.Slice&version=0.3.0

IceRPC + Slice integration

The IceRPC framework allows you to make RPCs with the serialization format and IDL of your choice. It provides full support for both Slice and Protobuf.

The IceRpc.Slice NuGet package is part of the IceRPC + Slice integration, and includes two .NET assemblies:

Package | Source code | Documentation | Examples | API reference

Sample Code

// Slice contract

module VisitorCenter

/// Represents a simple greeter.
interface Greeter {
    /// Creates a personalized greeting.
    /// @param name: The name of the person to greet.
    /// @returns: The greeting.
    greet(name: string) -> string
}
// Client application

using IceRpc;
using VisitorCenter;

await using var connection = new ClientConnection(new Uri("icerpc://localhost"));

// GreeterProxy is a struct generated by the Slice compiler; its implementation uses
// IceRpc.Slice.
var greeter = new GreeterProxy(connection);
string greeting = await greeter.GreetAsync(Environment.UserName);

Console.WriteLine(greeting);

await connection.ShutdownAsync();
// Server application

using IceRpc;
using IceRpc.Features;
using IceRpc.Slice;
using VisitorCenter;

await using var server = new Server(new Chatbot());
server.Listen();

// Wait until the console receives a Ctrl+C.
await CancelKeyPressed;
await server.ShutdownAsync();

// IGreeterService is an interface generated by the Slice compiler.
// The [SliceService] attribute instructs the Slice Service source generator (provided by
// IceRpc.Slice.Generators.dll) to implement IDispatcher by directing "greet" requests to
// the GreetAsync method.
[SliceService]
internal partial class Chatbot : IGreeterService
{
    public ValueTask<string> GreetAsync(
        string name,
        IFeatureCollection features,
        CancellationToken cancellationToken)
    {
        Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}");
        return new($"Hello, {name}!");
    }
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on IceRpc.Slice:

Package Downloads
IceRpc.Locator The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Locator interceptor for IceRPC

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.3.1 220 3/28/2024
0.3.0 466 2/14/2024
0.2.1 360 12/12/2023
0.2.0 308 12/4/2023
0.1.2 319 10/9/2023
0.1.1 127 9/18/2023
0.1.0 142 9/6/2023