Commit graph

170 commits

Author SHA1 Message Date
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
Johan Andrén
d52be450f3 ScanAsync did not complete in all scenarios #24036 (#24090) 2017-12-05 08:08:33 +00:00
Konrad `ktoso` Malawski
a40826e1cb =str #22881 test also resume case for throwing mid-stream mapAsync (#22915)
* =str #22880 fix mapAsync racy failure handling

* =str #22881 test also resume case for throwing mid-stream mapAsync

* address review feedback, the handle calls must be exactly like that
2017-09-11 14:17:13 +02:00
Gilad Hoch
0bcf32fccb =str #23398 groupedWeightedWithin zero cost bugfix (#23399)
* added a failing test to demonstrate a bug in groupedWeightedWithin with zero cost function

* fixed the bug by adding a flag indicating if there are elements in buffer, and using it instead of totalWeight in case onTimer is called
2017-08-08 13:30:32 +02:00
Konrad `ktoso` Malawski
b7d7316c1c =str #22917 recoverWithRetries allow 0 and negative values 2017-06-13 11:18:46 +02:00
Gilad Hoch
edee4ba409 +str #22711 adding GroupedWeightedWithin 2017-04-28 15:07:06 +02:00
Thomas Alton
626d07edca Schedule timer for remaining delayed elements #22416 2017-03-30 16:27:01 +02:00
Martynas Mickevičius
2a9c0370e0 Add @InternalApi annotations and private markers on internal apis (#22563)
* #22506 Mark materializer extension as @InternalApi

* #22506 Added missing annotations on internal apis in the fusing package

* #22506 Missing annotations in io package

* #22506 Add internal api annotations in impl package

* #22563 more hiding of the classes in the impl package

* #22563 Formatting fixes

* #22506 Fix private access in stream tcl tests
2017-03-16 20:04:07 +01:00
Sergey
ba213b7fee GroupedWithin cold emit fix (#22407)
* groupedWithin cold emit fix

* lowered numbers in tests; removed meaningless assertions
2017-03-14 13:45:45 +01:00