Commit graph

155 commits

Author SHA1 Message Date
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
Hawstein
873e87fb33 =str refine built-in Take and TakeWhile stages (#21871)
* refine build-in stages:

* change InHandler to avoid unnecessary condition check
* remove unnecessary local variable
* fix typo

* revert the drop stage change and remove timer
2017-02-14 12:24:28 +01:00
Philippus Baalman
6c7085252a extended copyright into 2017 2017-01-04 17:37:15 +01:00
Konrad Malawski
e7e1f74427 =str more specific error type if idle-timeout triggers in tcp 2016-12-14 12:39:24 +01:00
Hawstein
c373cef20f use SimpleLinearGraphStage to reduce the boilerplate code #21830 2016-11-18 10:13:15 +01:00
Hawstein
96a1d2a081 rewrite Buffer as a GraphStage #21528 2016-11-15 18:48:33 +01:00
Andy Chung
fff707781e Took grab and pull out of try 2016-11-04 16:13:11 +00:00
Andy Chung
a6a4d1ac7f Fixed error handling behaviour of Fold and Reduce 2016-11-04 10:38:35 +00:00
Falmarri
a28d2c579f Added a flag on takeWhile to allow it to include the final element, #21330 2016-10-18 12:02:59 +02:00
Mateus Dubiela Oliveira
c3abde60d5 Add scanAsync to Akka Streams, similar to scan but taking a Future (#21553)
* Add comprehensive tests
* Add documentation

* Damn comma after rebase

* Add documentation for foldAsync and scanAsync

* Rename aggreator and aggreating to current

* Remove out availability check

* Revert removing out and some refactors

* Formatting documentation

* Use after instead of Promise in test

* Use package reference to after and some refactoring
2016-10-17 16:43:11 +02:00
Vsevolod Belousov
0e60020c58 fold async emits zero given an empty stream #21562 2016-10-17 09:02:54 +02:00
Patrik Nordwall
79d8ec87fc Delay should not pull when buffer is full with Backpressure strategy, #21334
Additionally
* nano time conversion and calculation fix
* refactoring of Delay.onPush
2016-09-13 16:10:49 +02:00
Michał Płachta
b3bba1229f Make map stage final and refactor OneBoundedSetup to take a decider. (#21374)
* Remove new from Map constructions
2016-09-08 11:47:17 +02:00
Patrik Nordwall
a95b2d6746 fail fast in mapAsync for completed failed future, #21318 (#21322)
* fail fast in mapAsync for completed failed future, #21318

* the callback was not run until todo == parallelism or the sync
  event limit was reached, and that can be a problem if upstream
  stages are slow (noticed this for a blocking Kafka producer stage)

* skip callback for completed futures

* fix callback allocation
2016-08-30 19:30:08 +02:00
drewhk
f062687a0e Merge pull request #21259 from drewhk/wip-20933-recoverWith-nondetached-drewhk
#20933: Make RecoverWith non-detached (also eliminates race in test)
2016-08-30 10:38:00 +02:00
Cédric Chantepie
324a40ba97 =str Refactoring to avoid distinct handler instantiation for stage logics (#21309)
* Refactoring to avoid distinct handler instantiation for stage logics

* setHandlers
2016-08-29 13:00:48 +01:00