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

Updated example URLs to use 0.1.x branch #384

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions components/tags/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ export const Examples = () => {
<ExampleCard
title="GreeterLog"
description="A typical IceRPC application."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/GreeterLog"
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/GreeterLog"
/>
<ExampleCard
title="GenericHost"
description="IceRPC with the Microsoft DI container."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/GenericHost"
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/GenericHost"
/>
<ExampleCard
title="Stream"
description="Stream your data with IceRPC and Slice."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/Stream"
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/Stream"
/>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions content/icerpc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ integration will soon bring the same level of convenience to Protobuf.
{% mini-card
title="Core example"
description="Using IceRPC without an IDL."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/GreeterCore" /%}
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/GreeterCore" /%}

{% mini-card
title="JSON example"
description="Using IceRPC with JSON."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/GreeterJson" /%}
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/GreeterJson" /%}

{% mini-card
title="Protobuf example"
description="Using IceRPC with Protobuf."
href="https://github.com/icerpc/icerpc-csharp/tree/main/examples/GreeterProtobuf" /%}
href="https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/GreeterProtobuf" /%}

{% /grid %}

Expand Down
13 changes: 11 additions & 2 deletions content/slice/language-guide/parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,27 @@ Parameters have the same syntax as [fields](fields), with one exception: when an
this parameter cannot have a name. The syntax for this nameless return parameter is simply `Type` or `tag(N) Type?`.

For example:

```slice
greet(name: string) -> string // the return parameter has a type (string) but no name.
anotherGreet(name: string) -> tag(1) string? // the return parameter is tagged
```

{% /slice1 %}
{% slice2 %}
Parameters have the same syntax as [fields](fields), with two extensions:

1. When an operation returns a single parameter, this parameter cannot have a name. The syntax for this nameless return
parameter is simply `Type` or `tag(N) Type?`. For example:

```slice
greet(name: string) -> string // the return parameter has a type (string) but no name.
anotherGreet(name: string) -> tag(1) string? // the return parameter is tagged
```

2. The last parameter of an operation or return type may be a stream parameter, with the `stream` keyword before the
type. For example:

```slice
downloadFile(name: string) -> stream uint8

Expand Down Expand Up @@ -76,11 +81,12 @@ case. The type of the C# field is the mapped C# type for `Type`.
Tagged parameters are mapped just like regular parameters. The tag and tag number don't appear in the mapped C# API.

{% slice2 %}
### Stream parameters in C#
### Stream parameters in C #
ReeceHumphreys marked this conversation as resolved.
Show resolved Hide resolved

A stream parameter of type `uint8` is mapped to a [PipeReader]. For example:

{% side-by-side alignment="top" %}

```slice
interface ImageStore {
uploadImage(name: string, bytes: stream uint8)
Expand All @@ -97,6 +103,7 @@ public partial interface IImageStore
CancellationToken cancellationToken = default);
}
```

{% /side-by-side %}

When you give such a stream to the generated code, the IceRPC + Slice integration will complete this stream when it's
Expand All @@ -110,6 +117,7 @@ For all other stream element types, a stream parameter is mapped to an [`IAsyncE
the async enumerable element type is the mapped C# type for the Slice stream element type. For example:

{% side-by-side alignment="top" %}

```slice
interface TemperatureProbe {
read() -> stream float32
Expand All @@ -124,6 +132,7 @@ public partial interface ITemperatureProbe
CancellationToken cancellationToken = default);
}
```

{% /side-by-side %}

When you give such a stream to the generated code, the IceRPC + Slice integration will either iterate over all the
Expand All @@ -141,6 +150,6 @@ blocked or slow read operation on the underlying byte stream. {% /slice2 %}
[PipeReader]: https://learn.microsoft.com/en-us/dotnet/api/system.io.pipelines.pipereader
[Complete]: https://learn.microsoft.com/en-us/dotnet/api/system.io.pipelines.pipereader.complete
[CompleteAsync]: https://learn.microsoft.com/en-us/dotnet/api/system.io.pipelines.pipereader.completeasync
[Stream example]: https://github.com/icerpc/icerpc-csharp/tree/main/examples/Stream
[Stream example]: https://github.com/icerpc/icerpc-csharp/tree/0.1.x/examples/Stream
[WithCancellation]: https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskasyncenumerableextensions.withcancellation
[`IAsyncEnumerable<T>`]: https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.iasyncenumerable-1