Skip to content

Commit

Permalink
Updated example URLs to use 0.1.x branch (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReeceHumphreys authored Nov 21, 2023
1 parent 67585de commit fc88467
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
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
11 changes: 10 additions & 1 deletion 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 @@ -81,6 +86,7 @@ Tagged parameters are mapped just like regular parameters. The tag and tag numbe
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

0 comments on commit fc88467

Please sign in to comment.