Commit graph

1860 commits

Author SHA1 Message Date
Johan Andrén
4ade8ef2d1
Lazy and fast concat and prepend (#30252) 2021-05-27 17:18:47 +02:00
Yury Gribkov
cbb12e6ef3
Call BoundaryEvent cancellation hook for telemetry when ActorGraphInterpreter stops (#30259)
* Call BoundaryEvent cancellation hook for telemetry when ActorGraphInterpreter stops
* Add missing annotation to ActorCell.sendMessage
2021-05-27 17:13:17 +02:00
Yury Gribkov
49759617ab
Add BoundaryEvent cancellation hook for telemetry (#30246) 2021-05-20 18:10:44 +02:00
Arnout Engelen
79b48ca354
Remove SourceModule/SinkModule newInstance (#30244)
* Remove SourceModule/SinkModule newInstance

AFAICS it's not public API and not called anywhere
Extracted from #30223

* mima excludes
2021-05-19 20:51:30 +02:00
Johannes Rudolph
18e78816c3
stream: reuse maxBytesPerChunk buffer for inflate / gunzip (#30239)
Before, for every round of `parse` a new buffer was allocated that was then
copied again by `ByteString.fromArray`. This effectively more than doubled
the allocation rate while inflating. For bulk data like expected for
compressed data this can make a big difference in throughput.

The slight downside of keeping the buffer is that the stage now uses more memory
by default even while idle. deflate/gzip's window is 64kb which happens to be also the
default `maxBytesPerChunk` setting. It is therefore expected that the additional buffer will
less than double the existing memory footprint while dividing the allocation rate
by more than two which seems like a good trade-off.
2021-05-17 16:08:26 +02:00
Nicolas Vollmar
c04f6ca5a1
Removes unnecessary postStop #30071 (#30187)
* Removes unnecessary postStop #30071
* Adds test for future source with substream #30071
2021-04-20 10:36:30 +02:00
Johan Andrén
0a226eb3ea
Extra catch-ignore for source attributes in case not possible #30138 2021-04-09 14:01:49 +02:00
Andrea Zito
318b9614a3
Add draining control support to MergeHub #30057
- MergeHub materialization now produces a DrainingControl object alongside the Sink
- The DrainingControl can be invoked to initiate the draining procedure
- No new producers can be connected to the Hub
- The Hub is completed as soon as all the currently connected producers complete
2021-04-07 11:34:59 +02:00
Arman Bilge
f155ff12fa
Remove async boundary note in Source.actorRef docs (#30162) 2021-04-06 12:23:02 +02:00
Arman Bilge
40f1edf89f
Preserve attributes of inner stages when using {Source,Flow,Sink}.fromMaterializer (#30142) 2021-04-02 16:04:07 +02:00
Johan Andrén
c5655a9ce6
Upgrade to Scala 2.13.5 (#30072) 2021-03-30 20:57:23 +02:00
Seeta Ramayya
99af826546
Renamed single letter parameter (#30150)
* Renamed method parameter (`d` -> `duration`) in akka-actor-typed and akka-stream modules #30115

* Renamed method parameter (`n` -> `maxNumber`) and accordingly adjusted inline scala docs
2021-03-29 17:31:39 +02:00
Alex
651b339777
Added size() to BoundedSourceQueue #30124 (#30125) 2021-03-22 11:45:47 +01:00
Levi Ramsey
f3456b382e
Clarify API-docs - desugaring of IncomingConnection.handleWith (#30025) 2021-03-15 17:32:35 +01:00
Arman Bilge
1ff2950ab6
Inherit attributes from Restart{Source,Flow,Sink} #24810 2021-03-15 12:47:37 +01:00
Alex
1044c4996e
Extend GroupedWeightedWithin to accept maxWeight and maxNumber simultaneously #30020 2021-03-15 12:38:28 +01:00
Johannes Rudolph
0576acc1da
stream: add assertion against JDK bug to avoid spin loop in TlsActor (#30043)
* stream: add assertion against JDK bug to avoid spin loop in TlsActor

Refs #29922
2021-03-10 08:49:15 +01:00
Johan Andrén
89e04267db
Eliminate BidiFlow.identity in atop when possible #29901 2021-02-22 15:49:52 +01:00
Johan Andrén
8dfb4a7a3d
Source location in a few more stages (#30039) 2021-02-22 14:34:46 +01:00
Patrik Nordwall
f5625dc64d Don't use GraphStage toString when materializing Source.fromPublisher, #30022
* Fixes performance regression in Akka 2.6.11/2.6.12
2021-02-12 09:34:20 +01:00
Nicolas Vollmar
94af88c5de
Remove support for PoisonPill in ActorRefSource #26622 2021-02-05 11:46:34 +01:00
Andrea Peruffo
da70e0ccd4
Scala 3 cross compatible akka-actor / akka-testkit / akka-actor-tests (#29956)
* Remove @switch when it doesn't take effect
* Use ActorRef.noSender
* Minor tweaks to SchedulerSpec
* Disambiguate TypedActor for Scala 3
* Bump ScalaTest to a version compatible with Scala 3
* Bump ScalaCheck
* Disambiguate Event in SupervisorHierarchySpec
* Scala 3 compatible EventBusSpec
* Prevent private unused variables to be erased by Scala 3
* Bump mockito
* Explicit actorRef2Scala import
* restore original .scalafix.conf
* Scala 3 compatible tailrec
* Reminder to re add switch annotation in case
* Move to nowarn instead of silencer
* Bump to Scala 2.12.13
* Cross compatible annotations
* fix docs generation
* adapt the build for Scala 3
* fix errors but bus
* remove more SerialVersion from trait
* scalacheck only from scalatest
* cross-compile akka-actor-tests
* restore cross-compilation
* early initializers workaround
* scalacheck switch
* cross compatible FSM.State class
* cross compatible LARS spec
* Change results to pass LineNumberSpec
* fix stackoverflow in AsyncDnsResolverIntegrationSpec
* FSM.State unapply
* fix Scala 2.13 mima
* SerialVersionRemover compiler plugin
* removed unused nowarns
2021-02-01 16:38:29 +01:00
Michael Marshall
4d9b25579d
Add GroupedWeighted FlowOp and Make Grouped use GroupedWeighted #29066 2021-01-27 18:03:30 +01:00
Johan Andrén
0bf29fd232
SubSinkInlet/SubSourceOutlet memory leak fix (#29967)
* Memory leak in auto-closing of sub inlets/outlets fixed #29966
* Avoid separate nested instances of the AsyncCallback state classes for each async callback.
2021-01-25 15:35:54 +01:00
Johan Andrén
ccc4a2f48b
Improved operator string represenation #29935
* New attribute with source location information introduced and added to stages that takes lambdas
* Better default toString for GraphStageLogic including source location where possible
  and used that for debugging, errors and stream snapshots
2021-01-11 15:17:50 +01:00
Arnout Engelen
31f654768f
Update copyright to 2021 2021-01-08 17:55:38 +01:00
Arnout Engelen
9f3d0a9887
tcp: clearer debug message when connection is closed successfully (#29931) 2021-01-07 14:20:23 +01:00
Nicolas Vollmar
40713f836f
Adds variant accepting any ack message (#29586) (#29910) 2020-12-22 09:46:38 +01:00
kerr
8c0ffe3b2a
=str Remove outHandler of FlattenMerge (#29890) 2020-12-15 11:18:48 +01:00
Nitika Agarwal
268b46c8a8
Include name attribute in GraphStageLogic toString (#29877) 2020-12-10 18:45:00 +01:00
ohze.net
9416dedad7
Use scalafix to update scala 2.13.3, silencer 1.7.0 (#29367) 2020-12-09 09:20:13 +01:00
Johan Andrén
c9980216a1
Automatic closing of graph stage sub inlets/outlets #29790 2020-11-23 15:12:39 +01:00
eyal farago
1aaa2fb6bf
Akka 29784 stateful map concat relax f ret type (#29792)
* akka-29730__register_newshells_when_no_active_interpreters: unrelated warnings that act as compilation errors on my env.

* akka-29730__register_newshells_when_no_active_interpreters: introduce a reproduction for akka-29730. actor interpreter failed to register new shells introduced by flatMapPrefix when the current interpreter has completed.

* akka-29730__register_newshells_when_no_active_interpreters: fix akka-29730

* akka-29730__register_newshells_when_no_active_interpreters: scalafmtAll

* Update akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala

* akka-29730__register_newshells_when_no_active_interpreters: style

* akka-29730__register_newshells_when_no_active_interpreters: fmt

* akka-29730__register_newshells_when_no_active_interpreters: scalafmt

* akka-29730__register_newshells_when_no_active_interpreters: simplify shortCircuitBatch's condition.

* akka-29730__register_newshells_when_no_active_interpreters: salfmt

* akka-29730__register_newshells_when_no_active_interpreters: println => log.debug

* Update akka-stream/src/main/scala/akka/stream/impl/fusing/ActorGraphInterpreter.scala

Co-authored-by: eyal farago <eyal.farago@gmail.com>

* Update akka-stream-tests/src/test/scala/akka/stream/scaladsl/FlowFlatMapPrefixSpec.scala

* akka-29730__register_newshells_when_no_active_interpreters: tailrec shortCircuitBatch

* akka-29784__statefulMapConcat_relax_f_ret_type: modify scala dsl's statefulMapConcat and mapConcat to take a function returning an IterableOnce.

* akka-29784__statefulMapConcat_relax_f_ret_type: scalafmtall

* akka-29784__statefulMapConcat_relax_f_ret_type: remove redundant import.

* akka-29784__statefulMapConcat_relax_f_ret_type: remove another unused import.

* akka-29784__statefulMapConcat_relax_f_ret_type: organize imports and annotations around ccompat

* akka-29784__statefulMapConcat_relax_f_ret_type: scalafmtall

* akka-29784__statefulMapConcat_relax_f_ret_type: filter false negative MIMA issues.

* akka-29784__statefulMapConcat_relax_f_ret_type: flowWithCtx

* akka-29784__statefulMapConcat_relax_f_ret_type: avoid deprecated methods in scala 2.13

Co-authored-by: Johannes Rudolph <johannes.rudolph@gmail.com>
2020-11-09 09:19:23 +01:00
Johan Andrén
2b8d0b2285
BoundedSourceQueue API #29574
A new queue implementation that drops new elements immediately when the buffer is full. Does not use async callbacks like Source.queue with OverflowStrategy.dropNew, which can still result in OOM errors (#25798).
2020-11-06 09:00:15 +01:00
Sean Glover
779161d556 BoundedQueueSource API 2020-11-05 14:05:49 -05:00
Johannes Rudolph
708f8b870c stream: a fast dropping queue implementation 2020-11-02 09:14:01 -05:00
eyal farago
2bf09d8da2
stream: register newshells with no active interpreters (#29731)
Fixes #29730
2020-10-27 13:11:23 +01:00
r-glyde
a4acf23d05
Restart(Source|Flow|Sink): Configurable stream restart deadline (#29591) 2020-10-05 09:12:15 +02:00
Johan Andrén
5d279b6c9c
Proper threadsafe collection of stream snapshots, ignoring stopping streams. #28960 2020-09-28 17:03:50 +02:00
Johan Andrén
e3dadd981f
Handle SubSource already timed out on failure or completion #29095 (#29605) 2020-09-17 08:37:02 +02:00
Arnout Engelen
c41c0420ad
Update scala to 2.13.3 and silencer to 1.7.0 (#28991)
* Update scala to 2.13.3 and silencer to 1.7.0
* Also travis
* Fix various warnings
2020-08-10 12:54:38 +02:00
Arnout Engelen
327e16980d
Make warnings in Java code fatal (#28402) 2020-08-04 13:47:38 +02:00
Yufei Cai
58fa1e3604
fix StreamRefs IllegalStateException (#29432)
* Test SinkRefStage in the CumulativeDemand-after-UpstreamFinish scenario
2020-08-03 11:16:03 +02:00
yiksanchan
1d813fd9c2
doc(RetryFlow): explain with more details (#29229) 2020-07-28 17:44:53 +02:00
James Roper
558160702b
Added MergeSequence graph stage (#29247)
Fixes #28769

Use case for this is if you have a sequence of elements that has been
partitioned across multiple streams, and you want to merge them back
together in order. It will typically be used in combination with
`zipWithIndex` to define the index for the sequence, followed by a
`Partition`, followed by the processing of different substreams with
different flows (each flow emitting exactly one output for each input),
and then merging with this stage, using the index from `zipWithIndex`.

A more concrete use case is if you're consuming messages from a message
broker, and you have a flow that you wish to apply to some messages, but
not others, you can partition the message stream according to which
should be processed by the flow and which should bypass it, and then
bring the elements back together acknowledgement. If an ordinary merge
was used rather than this, the messages that bypass the processing flow
would likely overtake the messages going through the processing flow,
and the result would be out of order offset acknowledgement which would
lead to dropping messages on failure.

I've included a minimal version of the above example in the documentation.
2020-07-09 11:52:46 -04:00
Dave Handy
2f2ee9e67c
Change JsonFraming to fail stage if completing within an object #29228 2020-07-03 17:22:40 +02:00
eyal farago
d6fd8c30e0
stream: ensure async boundaries propagate cancellation causes (#29213)
Before, a cancellation cause might be lost if cancellation happened before subscription was completely handled.
2020-06-22 14:02:01 +02:00
contrun
4f2e82e5f6
stream: Unencoded attribute name (#28955) 2020-06-12 13:57:35 +02:00
Ignasi Marimon-Clos
4c5245e61e minor docs fixes 2020-06-08 18:24:53 +02:00
XIAO Yang
6328e0a6d6
Implement throttle for Source(Flow)WithContext (#29107) 2020-06-08 13:30:42 +02:00