Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix width of code samples #3654

Merged
merged 2 commits into from
Sep 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/IceRpc.Locator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
4 changes: 2 additions & 2 deletions src/IceRpc.Slice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> GreetAsync(
Expand Down
4 changes: 2 additions & 2 deletions src/IceRpc.Templates/README.md
Original file line number Diff line number Diff line change
@@ -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 |
Expand Down Expand Up @@ -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
13 changes: 9 additions & 4 deletions src/IceRpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ async Task<string> 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.
Expand Down Expand Up @@ -63,14 +63,19 @@ await server.ShutdownAsync();

internal class Chatbot : IDispatcher
{
public async ValueTask<OutgoingResponse> DispatchAsync(IncomingRequest request, CancellationToken cancellationToken)
public async ValueTask<OutgoingResponse> 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
{
Expand Down
6 changes: 4 additions & 2 deletions src/ZeroC.Slice/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -42,8 +44,8 @@ public partial record struct Person
...
}

/// <summary>Constructs a new instance of <see cref="Person" /> and decodes its fields from a Slice decoder.
/// </summary>
/// <summary>Constructs a new instance of <see cref="Person" /> and decodes its fields from
/// a Slice decoder.</summary>
/// <param name="decoder">The Slice decoder.</param>
public Person(ref SliceDecoder decoder)
{
Expand Down
Loading