Commit graph

178 commits

Author SHA1 Message Date
Alex
1044c4996e
Extend GroupedWeightedWithin to accept maxWeight and maxNumber simultaneously #30020 2021-03-15 12:38:28 +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
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
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
eyal farago
de59bb6803
Replace LazyFlow with FutureFlow (#28729)
And implement other lazy flows on top of it

Co-Authored-By: Johannes Rudolph <johannes.rudolph@gmail.com>
2020-05-14 10:28:53 +02:00
kerr
0e4d41ad33
+build Add sort imports support. (#28780)
* Add scalafix plugin for jdk 9.
* Add command alias sortImports.
* Excludes some sources from SortImports.
* Update SortImports to 0.4.0
* Sort imports with `sortImports` command.
2020-04-27 14:32:18 +02:00
Johan Andrén
d26453b5e8
Clean up same thread execution contexts #26690
* deprecate internal sameThread ec and use a new one for all internal use sites
* Use the respective Scala version standard library "same thread" ec 
* fallback to the old inline impl on 2.12 when reflection isn't possible
2020-03-10 15:39:30 +01:00
Johan Andrén
c46861ed26
Add LogWithMarker to Akka Stream #28450 2020-03-05 15:05:05 +01:00
Johan Andrén
3157b0199b
MapAsync wouldn't complete when upstream does in all scenarios #28657 2020-03-03 17:17:50 +01:00
Johannes Rudolph
c39dd6506e
stream: filter out elements without demand
This will also mean that completion will not be blocked by elements that
will later be filtered out.

One particular use case of that would be a kind of partitioning use case,
where you put several streams behind a broadcast and each consumer will filter
out elements not handled there. In that case, the broadcast can get head-of-line
blocked when one of the consumers currently has no demand but also wouldn't
have to handle any elements because they would all be filtered out.
2020-01-22 10:26:46 +01:00
__
e182c5a1fc Add stream name to buffer overflow log message (#28159)
* Add stream name to buffer overflow log message (#28085)

* De-emphasize stream name by moving it to the back

Co-authored-by: Arnout Engelen <github@bzzt.net>
2020-01-06 16:18:43 +01:00
Helena Edelson
6bf20f4117 Update all copyright headers to 2020 after new year's #27881 (#28434) 2020-01-02 13:24:59 +01:00
Johan Andrén
583fe3e2a4
Delay operator emit early fix #28269
* Bugfix for delay stage with EmitEarly #28269

Emit early would make it pull eagerly even if out was not available,
when element arrived and buffer was full and out not available that
element would be left in the input port and never end up in the buffer.

* Additional cleanup of the Delay stage
2019-11-29 14:46:51 +01:00
Jean-Baptiste Giraudeau
6d893fb571 Flow.delayWith allows custom delay for each element. (#25000) 2019-11-27 17:30:56 +01:00
Johan Andrén
61bd3d42b6
Document and fix getAsyncCallback thread safety issues #27999 2019-11-22 13:38:06 +01:00
Johan Andrén
74adecb4e7
Align lazy and future operators #26446 2019-10-16 17:02:12 +02:00
Patrik Nordwall
4e8a5d333b
More structured logger names, #27922 (#27934)
* some cluster logging improvements
* most logger names are actually good, when using ActorLogging since
  config can be setup on the package (prefix)
* override logSource when StageLogging is used
* replace system.log with more specific logger
2019-10-14 17:55:12 +02:00
Johan Andrén
ed955e0da4 Propagate downstream cancellation failures (#27547)
* Add doc clarification about IOResult on sources
* Better error message for IOOperationIncompleteException

Co-Authored-By: Johannes Rudolph <johannes.rudolph@gmail.com>
2019-09-05 20:55:48 +02:00
Johan Andrén
b68d67008a
Deprecate actor materializer (#27538) 2019-09-05 16:08:37 +02:00
Johan Andrén
aca63ea198
Materializer settings as attributes (#27499)
* Replace MaterializerSettings with Attributes #25559 
 * Field access to settings deprecated to make stages use attributes instead
 * Internal stages updated to use attributes
 * Docs on ActorMaterializerSettings updated to recommend away from using it
 * Verify all stages stopped after each testcase in FlowGroupBySpec
 * Subscription timeout attributes merged into one
2019-09-04 13:37:06 +02:00
Johannes Rudolph
f51dc373be Handle rethrows in recover more gracefully (#27506)
The idea is that `.recover { xyz => throw newException }` is common enough
not to log an ERROR message just because we didn't catch it in the Recover stage.

On the other hand, using `mapError` can be a better choice if you just want to
map the error (but there might be other occurrences where a partial function is not
enough to avoid throwing an error from recover).
2019-08-28 10:44:02 +02:00
Johannes Rudolph
16033eaf5e Propagate stream cancellation causes (#27266)
* base functionality
* fix-restart-flow
* Fix subSource / subSink cancellation handling
* GraphStage-fix
* Fix ambiguity between complete and cancellation (for isAvailable / grab)
* rename lastCancellationCause
* add mima
* fix cancellation cause propagation in OutputBoundary
* Fix cancellation cause propagation in SubSink
* Add cancellation cause logging to Flow.log
* add more comments about GraphStage portState internals
* Add some assertions in onDownstreamFinish to prevent wrong usage
* Also deprecate onDownstreamFinish() so that no one calls the wrong one
accidentally
* add SubSinkInlet.cancel(cause)
* Propagate causes in two other places
* Suggest to use `cancel(in, cause)` but don't deprecate old one
2019-08-16 10:53:14 +02:00
Xin Yin
44dcfe057a Fix an issue of prolonged delay in the Delay stage #26470 2019-07-05 09:07:16 +02:00
Johan Andrén
7c6d3b818a FlowDelay with EmitEarly caused a NPE (#27170) 2019-07-04 11:06:24 +02:00
Patrik Nordwall
10d32fceb9 scheduleWithFixedDelay vs scheduleAtFixedRate, #26910
* previous `schedule` method is trying to maintain a fixed average frequency
  over time, but that can result in undesired bursts of scheduled tasks after a long
  GC or if the JVM process has been suspended, same with all other periodic
  scheduled message sending via various Timer APIs
* most of the time "fixed delay" is more desirable
* we can't just change because it's too big behavioral change and some might
  depend on previous behavior
* deprecate the old `schedule` and introduce new `scheduleWithFixedDelay`
  and `scheduleAtFixedRate`, when fixing the deprecation warning users should
  make a concious decision of which behavior to use (scheduleWithFixedDelay in
  most cases)

* Streams
* SchedulerSpec
  * test both fixed delay and fixed rate
* TimerSpec
* FSM and PersistentFSM
* mima
* runnable as second parameter list, also in typed.Scheduler
* IllegalStateException vs SchedulerException
* deprecated annotations
* api and reference docs, all places
* migration guide
2019-06-05 11:38:04 +02:00
mszczygiel
d4813b91c3 Support for null in mapAsync and fromCompletionStage #25475 2019-04-16 09:08:05 +02:00
Johan Andrén
7e7901ad49
akka-stream compiler warnings as fatal errors (#26673) 2019-04-05 13:06:33 +02:00
Auto Format
75579bed17 format source with scalafmt, #26511 2019-03-15 10:23:46 +01:00
Auto Format
ce404e4f53 format source with scalafmt 2019-03-11 16:58:55 +01:00
Patrik Nordwall
5c96a5f556 replace unicode arrows
* ⇒, →, ←
* because we don't want to show them in documentation snippets and
  then it's complicated to avoid that when snippets are
  located in src/test/scala in individual modules
* dont replace object `→` in FSM.scala and PersistentFSM.scala
2019-03-11 16:58:51 +01:00
Christopher Batey
51add23b2a Cleanup various warnings in akka-stream #26395 2019-02-26 18:28:29 +01:00
kerr
bdc90052aa Update headers from 2018 to 2019 once for all. (#26165)
* Add CopyrightHeader support for sbt-boilerplate plugin.
* Add CopyrightHeader support for `*.proto` files.
* Add regex match for both `–` and `-` for CopyrightHeader.
* Add CopyrightHeader support for sbt build files.
* Update copyright from 2018 to 2019.
2019-01-02 11:55:26 +01:00
Nicolas Vollmar
8b8c7355bf Adding loglevel for overflow strategy #25949 (#25976)
* Adding loglevel for overflow strategy (#25949)

* Simplifying overflow strategy api (#25949)

* Adding overflow strategy check for backpressu (#25949)

* Adding log statements to all stages with overflow strategy (#25949)

* Adding excludes for internal api changes (#25949)

* Adding internal api annotations (#25949)

* Adding log source overrides for better logger names (#25949)

* Moving mima excludes for 2.5.18 (#25949)
2018-12-05 13:31:43 +00:00
kerr
fafc59b19d update headers to regular comment (#25807) 2018-10-29 05:19:37 -04:00
Patrik Nordwall
63ceb52bbd Use supervision in all places of Source.fromIterator, #25574 (#25601)
* it was noticed in Source.fromIterator depending on where the
  iterator throwed exception
* fromIterator, as many other things, is implemented with
  statefulMapConcat
* supervision was only used for exceptions in onPush and not
  in onPull, added it there also
2018-09-19 18:06:24 +09:00
Richard S. Imaoka
60eee84345 Replace graph with operator in Scaladoc/Javadoc 2018-06-09 17:42:56 +09:00
Sergey Kisel
f4cc1dd0f9 ScanAsync handling fully complete stream while future is resolved #25112 2018-05-30 13:01:18 +03:00
Konrad `ktoso` Malawski
7fa28b3488
consistent wording; stream ops are "operators" (#25064) 2018-05-09 16:50:32 +02:00
Stefan Wachter
3db145643a materialized value of Flow.lazyInit must be a Future #24670 (#24685)
* change materialized value of LazyFlow from [M] to Future[Option[M]]

* remove whitespace

* improve docu

* restore old Flow.lazyInit method and add new Flow.lazyInitAsync method

* fix deprecation messages

* add 2.5.11.backwards.excludes because of changed LazyFlow constructor signature

* check switching behaviour

* apply formatting

* improve deprecation message; improve null safety

* prevent premature stage completion by setting keepGoing

* deprecate Sink.lazyInit; add Sink.lazyInitAsync

* apply formatting

* add ProblemFilter.exclude for changed LazySink.this

* Update Sink.scala

* Update Sink.scala

* Update Flow.scala

* Update Flow.scala
2018-03-19 22:42:37 +09:00
Jimin Hsieh
2c2b8ba001 Remove some of Unused import warning (#24650) 2018-03-16 12:08:29 +01:00
Konrad `ktoso` Malawski
563c7fbcf0 Issue 24594: Integration with sbt-headers and initial header population 2018-03-13 15:45:55 +01:00
Kevin Mas Ruiz
907c6a6931 Do not drop messages in delay with EmitEarly when buffer overflows (#24642) 2018-03-12 14:08:06 +01:00
Konrad Malawski
4714f16dcf +str #18142 ask pattern integration for akka streams
progressed with cleanup, removing the same thread exec context is
weird... causes issues :-/ Need to debug more, could be that some race
also exists in mapAsync then :\

WIP

finish ask impl via watch stage

mima

consistency spec

fix paradox, and fix adding ask/watch to javadsl source

follow up review
2018-02-22 19:50:46 +09:00
gosubpl
edc67e0c3f +str Add Flow.lazyInit (#24427) (#24527) 2018-02-22 08:11:31 +01:00
Johan Andrén
4dde0742d0 Untangle settings from attributes in materializer #24063
Instead of renaming - deprecating and documenting

Renaming defaultInitialAttributes to defaultAttributes and adding docs

Tests passing

More work on using attributes for the attribute settings in ActorMaterializerSettings

Mark some attributes as mandatory and provide a smoother access w/o allocation for those

Another warning notice

MiMa filters

Part of the review adressed

Incorrect rebase fixed + formatting

Review feedback adressed

Formatting ...
2018-01-11 14:14:38 +09:00
Christopher Batey
009214ae07
Update copyright to 2018 (#24241) 2018-01-04 17:26:29 +00:00
Johan Andrén
af8a81f45f
MapAsync and already failed futures #24117 2017-12-07 10:09:15 +01:00
Johan Andrén
fb689baab8
Do not invoke the supervisor twice for the same MapAsync failure #23888 2017-12-05 18:51:58 +01:00