Skip to content

Commit 097e925

Browse files
authored
Merge branch 'dev' into FlowIdleInjectSpec
2 parents 69e9cd7 + d925fd5 commit 097e925

File tree

65 files changed

+2026
-1872
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+2026
-1872
lines changed

README.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,16 @@ You can start by taking the [Akka.NET Bootcamp](https://learnakka.net/), but the
4141

4242
## Build Status
4343

44-
| Stage | Status |
45-
|------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
46-
| Build | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=Windows%20Build)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
47-
| NuGet Pack | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=NuGet%20Pack)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
48-
| .NET Framework Unit Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Framework%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
49-
| .NET Framework MultiNode Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Framework%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
50-
| .NET Core (Windows) Unit Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
51-
| .NET Core (Linux) Unit Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Unit%20Tests%20(Linux))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
52-
| .NET Core (Windows) MultiNode Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Core%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
53-
| .NET Core (Linux) MultiNode Tests | |
54-
| Docs | [![Build Status](https://dev.azure.com/petabridge/akkadotnet-tools/_apis/build/status/Akka.NET%20Docs?branchName=dev)](https://dev.azure.com/petabridge/akkadotnet-tools/_build/latest?definitionId=82&branchName=dev) |
44+
| Stage | Status |
45+
|------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
46+
| Build | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=Windows%20Build)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
47+
| NuGet Pack | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=NuGet%20Pack)](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
48+
| .NET Framework Unit Tests | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%20Framework%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
49+
| .NET 7 Unit Tests (Windows) | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%207%20Unit%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
50+
| .NET 7 Unit Tests (Linux) | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%207%20Unit%20Tests%20(Linux))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
51+
| .NET 7 MultiNode Tests (Windows) | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%207%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) |
52+
| .NET 7 MultiNode Tests (Linux) | [![Build Status](https://dev.azure.com/dotnet/Akka.NET/_apis/build/status/akka.net/PR%20Validation?branchName=dev&jobName=.NET%207%20Multi-Node%20Tests%20(Windows))](https://dev.azure.com/dotnet/Akka.NET/_build/latest?definitionId=84&branchName=dev) | |
53+
| Docs | [![Build Status](https://dev.azure.com/petabridge/akkadotnet-tools/_apis/build/status/Akka.NET%20Docs?branchName=dev)](https://dev.azure.com/petabridge/akkadotnet-tools/_build/latest?definitionId=82&branchName=dev) |
5554

5655

5756
## Install Akka.NET via NuGet

docs/articles/streams/builtinstages.md

+14-4
Original file line numberDiff line numberDiff line change
@@ -295,11 +295,11 @@ if more element are emitted the sink will cancel the stream
295295

296296
**cancels** If too many values are collected
297297

298-
### Foreach
298+
### ForEach
299299

300300
Invoke a given procedure for each element received. Note that it is not safe to mutate shared state from the procedure.
301301

302-
The sink materializes into a ``Task`` which completes when the
302+
The sink materializes into a ``Task<Done>`` which completes when the
303303
stream completes, or fails if the stream fails.
304304

305305
Note that it is not safe to mutate state from the procedure.
@@ -308,9 +308,19 @@ Note that it is not safe to mutate state from the procedure.
308308

309309
**backpressures** when the previous procedure invocation has not yet completed
310310

311-
### ForeachParallel
311+
### ForEachASync
312312

313-
Like ``Foreach`` but allows up to ``parallellism`` procedure calls to happen in parallel.
313+
Invoke a given procedure asynchronously for each element received. Note that if shared state is mutated from the procedure that must be done in a thread-safe way.
314+
315+
The sink materializes into a ``Task<Done>`` which completes when the stream completes, or fails if the stream fails.
316+
317+
**cancels** when a ``Task`` fails
318+
319+
**backpressures** when the number of ``Task``s reaches the configured parallelism
320+
321+
### ForEachParallel
322+
323+
Like ``ForEach`` but allows up to ``parallellism`` procedure calls to happen in parallel.
314324

315325
**cancels** never
316326

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.DotNet.verified.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@ namespace Akka.Actor
16141614
public sealed class SchedulerException : Akka.Actor.AkkaException
16151615
{
16161616
public SchedulerException(string message) { }
1617-
protected SchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1617+
public SchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
16181618
}
16191619
public class static SchedulerExtensions
16201620
{

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveCore.Net.verified.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,7 @@ namespace Akka.Actor
16121612
public sealed class SchedulerException : Akka.Actor.AkkaException
16131613
{
16141614
public SchedulerException(string message) { }
1615-
protected SchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1615+
public SchedulerException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
16161616
}
16171617
public class static SchedulerExtensions
16181618
{

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.Core.verified.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1960,6 +1960,8 @@ namespace Akka.Streams.Dsl
19601960
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<TIn>> FirstOrDefault<TIn>() { }
19611961
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEach<TIn>(System.Action<TIn> action) { }
19621962
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachAsync<TIn>(int parallelism, System.Func<TIn, System.Threading.Tasks.Task> action) { }
1963+
[System.ObsoleteAttribute("Use `ForEachAsync` instead, it allows you to choose how to run the procedure, by " +
1964+
"calling some other API returning a Task or using Task.Run. Obsolete since 1.5.1")]
19631965
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachParallel<TIn>(int parallelism, System.Action<TIn> action) { }
19641966
public static Akka.Streams.Dsl.Sink<TIn, TMat> FromGraph<TIn, TMat>(Akka.Streams.IGraph<Akka.Streams.SinkShape<TIn>, TMat> graph) { }
19651967
public static Akka.Streams.Dsl.Sink<TIn, Akka.NotUsed> FromSubscriber<TIn>(Reactive.Streams.ISubscriber<TIn> subscriber) { }

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.DotNet.verified.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Akka.Streams
1212
public sealed class AbruptStageTerminationException : System.Exception
1313
{
1414
public AbruptStageTerminationException(Akka.Streams.Stage.GraphStageLogic logic) { }
15-
protected AbruptStageTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
15+
public AbruptStageTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1616
}
1717
public class AbruptTerminationException : System.Exception
1818
{
@@ -1804,7 +1804,7 @@ namespace Akka.Streams.Dsl
18041804
public sealed class PartitionOutOfBoundsException : System.Exception
18051805
{
18061806
public PartitionOutOfBoundsException(string message) { }
1807-
protected PartitionOutOfBoundsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1807+
public PartitionOutOfBoundsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
18081808
}
18091809
public class PartitionWith<TIn, TOut0, TOut1> : Akka.Streams.Stage.GraphStage<Akka.Streams.FanOutShape<TIn, TOut0, TOut1>>
18101810
{
@@ -1960,6 +1960,8 @@ namespace Akka.Streams.Dsl
19601960
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<TIn>> FirstOrDefault<TIn>() { }
19611961
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEach<TIn>(System.Action<TIn> action) { }
19621962
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachAsync<TIn>(int parallelism, System.Func<TIn, System.Threading.Tasks.Task> action) { }
1963+
[System.ObsoleteAttribute("Use `ForEachAsync` instead, it allows you to choose how to run the procedure, by " +
1964+
"calling some other API returning a Task or using Task.Run. Obsolete since 1.5.2")]
19631965
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachParallel<TIn>(int parallelism, System.Action<TIn> action) { }
19641966
public static Akka.Streams.Dsl.Sink<TIn, TMat> FromGraph<TIn, TMat>(Akka.Streams.IGraph<Akka.Streams.SinkShape<TIn>, TMat> graph) { }
19651967
public static Akka.Streams.Dsl.Sink<TIn, Akka.NotUsed> FromSubscriber<TIn>(Reactive.Streams.ISubscriber<TIn> subscriber) { }
@@ -2391,7 +2393,7 @@ namespace Akka.Streams.Dsl
23912393
public sealed class TcpIdleTimeoutException : System.TimeoutException
23922394
{
23932395
public TcpIdleTimeoutException(string message, System.TimeSpan duration) { }
2394-
protected TcpIdleTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
2396+
public TcpIdleTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
23952397
public System.TimeSpan Duration { get; }
23962398
}
23972399
public class static TcpStreamExtensions

src/core/Akka.API.Tests/verify/CoreAPISpec.ApproveStreams.Net.verified.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Akka.Streams
1212
public sealed class AbruptStageTerminationException : System.Exception
1313
{
1414
public AbruptStageTerminationException(Akka.Streams.Stage.GraphStageLogic logic) { }
15-
protected AbruptStageTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
15+
public AbruptStageTerminationException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1616
}
1717
public class AbruptTerminationException : System.Exception
1818
{
@@ -1804,7 +1804,7 @@ namespace Akka.Streams.Dsl
18041804
public sealed class PartitionOutOfBoundsException : System.Exception
18051805
{
18061806
public PartitionOutOfBoundsException(string message) { }
1807-
protected PartitionOutOfBoundsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
1807+
public PartitionOutOfBoundsException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
18081808
}
18091809
public class PartitionWith<TIn, TOut0, TOut1> : Akka.Streams.Stage.GraphStage<Akka.Streams.FanOutShape<TIn, TOut0, TOut1>>
18101810
{
@@ -1960,6 +1960,8 @@ namespace Akka.Streams.Dsl
19601960
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<TIn>> FirstOrDefault<TIn>() { }
19611961
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEach<TIn>(System.Action<TIn> action) { }
19621962
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachAsync<TIn>(int parallelism, System.Func<TIn, System.Threading.Tasks.Task> action) { }
1963+
[System.ObsoleteAttribute("Use `ForEachAsync` instead, it allows you to choose how to run the procedure, by " +
1964+
"calling some other API returning a Task or using Task.Run. Obsolete since 1.5.2")]
19631965
public static Akka.Streams.Dsl.Sink<TIn, System.Threading.Tasks.Task<Akka.Done>> ForEachParallel<TIn>(int parallelism, System.Action<TIn> action) { }
19641966
public static Akka.Streams.Dsl.Sink<TIn, TMat> FromGraph<TIn, TMat>(Akka.Streams.IGraph<Akka.Streams.SinkShape<TIn>, TMat> graph) { }
19651967
public static Akka.Streams.Dsl.Sink<TIn, Akka.NotUsed> FromSubscriber<TIn>(Reactive.Streams.ISubscriber<TIn> subscriber) { }
@@ -2391,7 +2393,7 @@ namespace Akka.Streams.Dsl
23912393
public sealed class TcpIdleTimeoutException : System.TimeoutException
23922394
{
23932395
public TcpIdleTimeoutException(string message, System.TimeSpan duration) { }
2394-
protected TcpIdleTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
2396+
public TcpIdleTimeoutException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) { }
23952397
public System.TimeSpan Duration { get; }
23962398
}
23972399
public class static TcpStreamExtensions

src/core/Akka.Remote/Endpoint.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public EndpointDisassociatedException(string message)
329329
/// </summary>
330330
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
331331
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
332-
protected EndpointDisassociatedException(SerializationInfo info, StreamingContext context)
332+
public EndpointDisassociatedException(SerializationInfo info, StreamingContext context)
333333
: base(info, context)
334334
{
335335
}
@@ -361,7 +361,7 @@ public EndpointAssociationException(string message, Exception innerException) :
361361
/// </summary>
362362
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
363363
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
364-
protected EndpointAssociationException(SerializationInfo info, StreamingContext context)
364+
EndpointAssociationException(SerializationInfo info, StreamingContext context)
365365
: base(info, context)
366366
{
367367
}
@@ -386,7 +386,7 @@ public OversizedPayloadException(string message)
386386
/// </summary>
387387
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
388388
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
389-
protected OversizedPayloadException(SerializationInfo info, StreamingContext context)
389+
OversizedPayloadException(SerializationInfo info, StreamingContext context)
390390
: base(info, context)
391391
{
392392
}

src/core/Akka.Streams.Tests/Dsl/AttributesSpec.cs

+2
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public async Task Attributes_must_keep_the_outermost_attribute_as_the_least_spec
5757

5858
[Fact]
5959
public void Attributes_must_give_access_to_first_attribute()
60+
#pragma warning disable CS0618 // Type or member is obsolete
6061
=> Attributes.GetFirstAttribute<Attributes.Name>().Value.Should().Be("a");
62+
#pragma warning restore CS0618 // Type or member is obsolete
6163

6264
[Fact]
6365
public void Attributes_must_give_access_to_attribute_by_type()

src/core/Akka.Streams.Tests/Dsl/BidiFlowSpec.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ public void A_BidiFlow_must_suitably_override_attribute_handling_methods()
209209
var b = (BidiFlow<int, long, ByteString, string, NotUsed>)
210210
Bidi().WithAttributes(Attributes.CreateName("")).Async().Named("name");
211211

212-
b.Module.Attributes.GetFirstAttribute<Attributes.Name>().Value.Should().Be("name");
213-
b.Module.Attributes.GetFirstAttribute<Attributes.AsyncBoundary>()
212+
b.Module.Attributes.GetAttribute<Attributes.Name>().Value.Should().Be("name");
213+
b.Module.Attributes.GetAttribute<Attributes.AsyncBoundary>()
214214
.Should()
215215
.Be(Attributes.AsyncBoundary.Instance);
216216
}

src/core/Akka.Streams.Tests/Dsl/FlowGroupedWithinSpec.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public void A_GroupedWithin_must_group_early()
232232
}).ToArray());
233233

234234
RandomTestRange(Sys)
235-
.ForEach(_ => RunScript(script, Settings, flow => flow.GroupedWithin(3, TimeSpan.FromMinutes(10))));
235+
.Select(async _ => await RunScriptAsync(script, Settings, flow => flow.GroupedWithin(3, TimeSpan.FromMinutes(10))));
236236
}
237237

238238
[Fact]
@@ -255,7 +255,7 @@ public void A_GroupedWithin_must_group_with_rest()
255255
};
256256

257257
RandomTestRange(Sys)
258-
.ForEach(_ => RunScript(script(), Settings, flow => flow.GroupedWithin(3, TimeSpan.FromMinutes(10))));
258+
.Select(async _ => await RunScriptAsync(script(), Settings, flow => flow.GroupedWithin(3, TimeSpan.FromMinutes(10))));
259259
}
260260

261261
[Fact(Skip = "Skipped for async_testkit conversion build")]

0 commit comments

Comments
 (0)