From efb0c5cb193845687e7cfc86666c27178607f1dc Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Wed, 13 Sep 2023 17:18:18 -0400 Subject: [PATCH] Fix width of code samples --- src/IceRpc.Compressor/README.md | 8 ++++---- src/IceRpc.Deadline/README.md | 8 ++++---- .../README.md | 4 ++-- src/IceRpc.Locator/README.md | 3 ++- src/IceRpc.Logger/README.md | 8 ++++---- src/IceRpc.Metrics/README.md | 8 ++++---- src/IceRpc.RequestContext/README.md | 8 ++++---- src/IceRpc.Retry/README.md | 4 ++-- src/IceRpc.Slice/README.md | 8 ++++---- src/IceRpc.Telemetry/README.md | 8 ++++---- src/IceRpc.Templates/README.md | 4 ++-- src/IceRpc.Transports.Coloc/README.md | 4 ++-- src/IceRpc.Transports.Quic/README.md | 4 ++-- src/IceRpc/README.md | 17 +++++++++++------ src/ZeroC.Slice/README.md | 6 ++++-- 15 files changed, 55 insertions(+), 47 deletions(-) diff --git a/src/IceRpc.Compressor/README.md b/src/IceRpc.Compressor/README.md index efa2a17d9e..0aec44eb20 100644 --- a/src/IceRpc.Compressor/README.md +++ b/src/IceRpc.Compressor/README.md @@ -26,7 +26,7 @@ interface Greeter { ``` ```csharp -// Client application +// Client application (C#) using IceRpc; using VisitorCenter; @@ -47,7 +47,7 @@ string greeting = await greeterProxy.GreetAsync(Environment.UserName); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Slice; @@ -78,7 +78,7 @@ interface Greeter { ``` ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -102,7 +102,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Deadline/README.md b/src/IceRpc.Deadline/README.md index 7dc62a99c1..8924d3ee08 100644 --- a/src/IceRpc.Deadline/README.md +++ b/src/IceRpc.Deadline/README.md @@ -10,7 +10,7 @@ fields received with incoming requests. ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; @@ -23,7 +23,7 @@ Pipeline pipeline = new Pipeline() ``` ```csharp -// Server application +// Server application (C#) using IceRpc; @@ -39,7 +39,7 @@ server.Listen(); ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -60,7 +60,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Extensions.DependencyInjection/README.md b/src/IceRpc.Extensions.DependencyInjection/README.md index f9f63c81de..309bb2404c 100644 --- a/src/IceRpc.Extensions.DependencyInjection/README.md +++ b/src/IceRpc.Extensions.DependencyInjection/README.md @@ -8,7 +8,7 @@ IceRpc.Extensions.DependencyInjection helps you build applications with [IceRPC] ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -32,7 +32,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Locator/README.md b/src/IceRpc.Locator/README.md index fa71279c12..8ebcf28889 100644 --- a/src/IceRpc.Locator/README.md +++ b/src/IceRpc.Locator/README.md @@ -30,7 +30,8 @@ pipeline = pipeline .UseLocator(locatorProxy) .Into(connectionCache); -// A call on this proxy will use the locator to find the server address(es) associated with `/hello`. +// A call on this proxy will use the locator to find the server address(es) associated with +// `/hello`. // The locator interceptor caches successful resolutions. var wellKnownProxy = new HelloProxy(pipeline, new Uri("ice:/hello")); diff --git a/src/IceRpc.Logger/README.md b/src/IceRpc.Logger/README.md index b0b8c252b5..48a3f996e7 100644 --- a/src/IceRpc.Logger/README.md +++ b/src/IceRpc.Logger/README.md @@ -8,7 +8,7 @@ logs every dispatch. ## Sample code ```csharp -// Client application +// Client application (C#) using Microsoft.Extensions.Logging; using IceRpc; @@ -29,7 +29,7 @@ Pipeline pipeline = new Pipeline() ``` ```csharp -// Server application +// Server application (C#) using Microsoft.Extensions.Logging; using IceRpc; @@ -50,7 +50,7 @@ Router router = new Router() ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -71,7 +71,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Metrics/README.md b/src/IceRpc.Metrics/README.md index 98d0c88e4a..f26928dc02 100644 --- a/src/IceRpc.Metrics/README.md +++ b/src/IceRpc.Metrics/README.md @@ -12,7 +12,7 @@ You can display the collected measurements with [dotnet-counters][dotnet_counter ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; @@ -23,7 +23,7 @@ Pipeline pipeline = new Pipeline().UseMetrics().Into(connection); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; @@ -34,7 +34,7 @@ Router router = new Router().UseMetrics().Map<...>(...); ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -55,7 +55,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.RequestContext/README.md b/src/IceRpc.RequestContext/README.md index b599ef52b0..6b5f6fffca 100644 --- a/src/IceRpc.RequestContext/README.md +++ b/src/IceRpc.RequestContext/README.md @@ -9,7 +9,7 @@ features. ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; @@ -22,7 +22,7 @@ Pipeline pipeline = new Pipeline() ``` ```csharp -// Server application +// Server application (C#) using IceRpc; @@ -38,7 +38,7 @@ server.Listen(); ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -59,7 +59,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Retry/README.md b/src/IceRpc.Retry/README.md index 87a923b903..90d1b279ac 100644 --- a/src/IceRpc.Retry/README.md +++ b/src/IceRpc.Retry/README.md @@ -7,7 +7,7 @@ IceRpc.Retry provides an [IceRPC][icerpc-csharp] interceptor that retries failed ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; @@ -22,7 +22,7 @@ Pipeline pipeline = new Pipeline() ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Slice/README.md b/src/IceRpc.Slice/README.md index 93c769a7dc..8b7eed060f 100644 --- a/src/IceRpc.Slice/README.md +++ b/src/IceRpc.Slice/README.md @@ -24,7 +24,7 @@ interface Greeter { ``` ```csharp -// Client application +// Client application (C#) using IceRpc; using VisitorCenter; @@ -41,7 +41,7 @@ await connection.ShutdownAsync(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Features; @@ -55,8 +55,8 @@ server.Listen(); await CancelKeyPressed; await server.ShutdownAsync(); -// Class IceRpc.Slice.Service is an IceRPC dispatcher. This dispatch is implemented by Chatbot and helper code provided -// by the IGreeterService interface generated by the Slice compiler. +// Class IceRpc.Slice.Service is an IceRPC dispatcher. This dispatch is implemented by Chatbot and +// helper code provided by the IGreeterService interface generated by the Slice compiler. internal class Chatbot : Service, IGreeterService { public ValueTask GreetAsync( diff --git a/src/IceRpc.Telemetry/README.md b/src/IceRpc.Telemetry/README.md index d6512ab6be..1518034fff 100644 --- a/src/IceRpc.Telemetry/README.md +++ b/src/IceRpc.Telemetry/README.md @@ -12,7 +12,7 @@ middleware restores the activity context and uses it to set the parent activity ## Sample code ```csharp -// Client application +// Client application (C#) using IceRpc; @@ -26,7 +26,7 @@ Pipeline pipeline = new Pipeline().UseTelemetry(activitySource).Into(connection) ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using VisitorCenter; @@ -41,7 +41,7 @@ Router router = new Router().UseTelemetry(activitySource); ## Sample code with DI ```csharp -// Client application +// Client application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; @@ -64,7 +64,7 @@ host.Run(); ``` ```csharp -// Server application +// Server application (C#) using IceRpc; using IceRpc.Extensions.DependencyInjection; diff --git a/src/IceRpc.Templates/README.md b/src/IceRpc.Templates/README.md index 32345a777d..3af7921eba 100644 --- a/src/IceRpc.Templates/README.md +++ b/src/IceRpc.Templates/README.md @@ -1,5 +1,7 @@ # Templates for IceRPC +[Source code][source] | [Package][package] + IceRpc.Templates provides `dotnet new` project templates for [IceRPC][icerpc]. The following templates are included: | Template Name | Description | @@ -35,8 +37,6 @@ dotnet build dotnet run ``` -[Source code][source] | [Package][package] - [icerpc]: https://www.nuget.org/packages/IceRpc [package]: https://www.nuget.org/packages/IceRpc.Templates [source]: https://github.com/icerpc/icerpc-csharp/tree/main/src/IceRpc.Templates diff --git a/src/IceRpc.Transports.Coloc/README.md b/src/IceRpc.Transports.Coloc/README.md index 8e210c2736..7446e965cc 100644 --- a/src/IceRpc.Transports.Coloc/README.md +++ b/src/IceRpc.Transports.Coloc/README.md @@ -13,7 +13,7 @@ This transport does not use network APIs. It is available on all platforms. ## Sample code ```csharp -// Create an IceRPC server with Coloc +// Create an IceRPC server with Coloc (C#) using IceRpc; using IceRpc.Transports.Coloc; @@ -26,7 +26,7 @@ await using var server = new Server( server.Listen(); -// Create a client connection to this server +// Create a client connection to this server (C#) await using var connection = new ClientConnection( new Uri("icerpc://host"), // you can use any host and port with coloc diff --git a/src/IceRpc.Transports.Quic/README.md b/src/IceRpc.Transports.Quic/README.md index 976d34778f..76428a0870 100644 --- a/src/IceRpc.Transports.Quic/README.md +++ b/src/IceRpc.Transports.Quic/README.md @@ -10,7 +10,7 @@ QUIC is a new UDP-based multiplexed transport used by HTTP/3 and several other a ## Sample code ```csharp -// Create an IceRPC client connection with QUIC +// Create an IceRPC client connection with QUIC (C#) using IceRpc; using IceRpc.Transports.Quic; @@ -23,7 +23,7 @@ await using var connection = new ClientConnection( ``` ```csharp -// Create an IceRPC server with QUIC +// Create an IceRPC server with QUIC (C#) using IceRpc; using IceRpc.Transports.Quic; diff --git a/src/IceRpc/README.md b/src/IceRpc/README.md index ef376e947b..46b89a0472 100644 --- a/src/IceRpc/README.md +++ b/src/IceRpc/README.md @@ -8,7 +8,7 @@ and package represent the base assembly and package for the [C# implementation o ## Sample Code ```csharp -// Client application +// Client application (C#) using GreeterCore; // for the StringCodec helper class using IceRpc; @@ -30,8 +30,8 @@ async Task GreetAsync(string name) Payload = StringCodec.EncodeString(name) }; - // Make the invocation: we send the request using the client connection and then wait for the response. Since the - // client connection is not connected yet, this call also connects it. + // Make the invocation: we send the request using the client connection and then wait for the + // response. Since the client connection is not connected yet, this call also connects it. IncomingResponse response = await connection.InvokeAsync(request); // When the response's status code is Ok, we decode its payload. @@ -48,7 +48,7 @@ async Task GreetAsync(string name) ``` ```csharp -// Server application +// Server application (C#) using GreeterCore; // for the StringCodec helper class using IceRpc; @@ -63,14 +63,19 @@ await server.ShutdownAsync(); internal class Chatbot : IDispatcher { - public async ValueTask DispatchAsync(IncomingRequest request, CancellationToken cancellationToken) + public async ValueTask DispatchAsync( + IncomingRequest request, + CancellationToken cancellationToken) { if (request.Operation == "greet") { string name = await StringCodec.DecodePayloadStringAsync(request.Payload); Console.WriteLine($"Dispatching greet request {{ name = '{name}' }}"); - return new OutgoingResponse(request) { Payload = StringCodec.EncodeString($"Hello, {name}!") }; + return new OutgoingResponse(request) + { + Payload = StringCodec.EncodeString($"Hello, {name}!") + }; } else { diff --git a/src/ZeroC.Slice/README.md b/src/ZeroC.Slice/README.md index 6488f07a58..595303fb62 100644 --- a/src/ZeroC.Slice/README.md +++ b/src/ZeroC.Slice/README.md @@ -17,6 +17,8 @@ Unlike older C# libraries, Slice relies on [System.Buffers][cs-buffers] (`IBuffe ## Sample Code ```slice +// Slice definition + struct Person { name: string id: int32 @@ -42,8 +44,8 @@ public partial record struct Person ... } - /// Constructs a new instance of and decodes its fields from a Slice decoder. - /// + /// Constructs a new instance of and decodes its fields from + /// a Slice decoder. /// The Slice decoder. public Person(ref SliceDecoder decoder) {