Commit graph

1116 commits

Author SHA1 Message Date
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
Patrik Nordwall
249af61ede
Merge pull request #29382 from JoelWee/25468-docs-merge-preferred-prioritized
Add mergePreferred, mergePrioritized docs (#25468)
2020-08-10 09:00:09 +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
Joel Wee
54efafd07d Add mergePreferred, mergePrioritized docs (#25468) 2020-07-14 18:03:18 +08: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
Arnout Engelen
9641780054
Avoid triggering IntelliJ's dead code detection (#29242) 2020-06-15 15:06:08 +01:00
XIAO Yang
6328e0a6d6
Implement throttle for Source(Flow)WithContext (#29107) 2020-06-08 13:30:42 +02:00
Johannes Rudolph
e524a0d445
stream: run TlsSpec for TLSv1.3 on jdk >= 11
Session renegotiation tests are disabled because TLS 1.3 does not
support renegotiation any more.
2020-05-27 15:03:06 +02: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
Arnout Engelen
9a1d5191b9
Allow taking a stream snapshot of a stream that uses TLS (#29047) 2020-05-13 09:14:04 +02:00
kerr
bada816714
=build Fix commandAlias for fixall and sortImports (#28984)
* =build Fix commandAlias for fixall and sortImports

* =build Update sortImports to 0.5.0

* Sort imports to handle `javax`.

* fx
2020-05-11 11:47:33 +02:00
Christopher Batey
0a208f4cb8
Fix race condition in InputStreamSinkSpec (#28990)
There's only one read so it was relying on both the Data and the Failed
being in the shared queue when it takes place.

Remove the data so that the poll on the shared queue will wait for the
Failed to be added.

Ref #28829
2020-05-07 10:33:24 +01:00
contrun
2104849658
add Source.never (#29008)
* add Source.never

* make Source.never single instance, add DefaultAttributes
2020-05-06 10:33:15 +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
ohze.net
ea7205eaf7
dotty phase 2: scalafix ExplicitNonNullaryApply (#28949)
* scalafix ExplicitNonNullaryApply prepare

+ Temporarily use com.sandinh:sbt-scalafix because scalacenter/scalafix#1098
+ Add ExplicitNonNullaryApply rule to .scalafix.conf
+ Manually fix a NonNullaryApply case in DeathWatchSpec that cause
  `fixall` fail because ExplicitNonNullaryApply rule incorrectly rewrite
  `context unbecome` to `context unbecome()` instead of `context.unbecome()`

* scalafix ExplicitNonNullaryApply

fix by enabling only ExplicitNonNullaryApply rule in .scalafix.conf then:
```
% sbt -Dakka.build.scalaVersion=2.13.1
> fixall
```

* scalafmtAll

* Revert to ch.epfl.scala:sbt-scalafix

Co-authored-by: Bùi Việt Thành <thanhbv@sandinh.net>
2020-04-27 12:31:16 +02:00
Bùi Việt Thành
02b9b30354 scalafix ExplicitResultTypes - for implicit members 2020-04-20 17:59:50 +07:00
Takuya Kajiwara
0933d7456e
add import clause to graphDSL example code to compile (#28830) 2020-03-30 09:59:18 +02:00
Yakiv Yereskovskyi
5605f04cb7
allow Source.queue concurrent pushing (#28273) 2020-03-26 10:56:45 -04:00
B YI
1545f3fb25
Doc example for Sink.head (#28782) 2020-03-23 14:03:09 +01:00
Jacek Ewertowski
2cccfa3c29
Stream: Sugar for Sink.ignore #27789, #24986 2020-03-23 13:05:25 +01:00
Eike Wacker
630e712b9f
Allow a read of length 0 in InputStreamAdapter #28751 (#28759) 2020-03-20 11:33:00 +01: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
Enno
52c83dca34
Docs: Sink.foreach (#28693) 2020-03-10 09:37:34 +01:00
Johan Andrén
c46861ed26
Add LogWithMarker to Akka Stream #28450 2020-03-05 15:05:05 +01:00
Arnout Engelen
e487088a27
Allow closing StreamConverter InputStream twice #28664 2020-03-04 17:12:50 +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
Johan Andrén
f781939353
Incorrect assumption in test #28620 (#28643) 2020-03-03 10:49:45 +01:00
eyal farago
5bb9a7145a
stream: provide mapMaterializedValue for Graph (#28610) 2020-02-20 13:30:32 +01:00
Arnout Engelen
8a354ec3f0
stream: Improve half-closing of outgoing TCP connections (#28624)
Notably fixes the case where upstream finished before the connection
was successfully established, and avoids RSTing the incoming stream
when the outgoing stream is done (which is now possible due to the
cancellation reason being propagated).
2020-02-20 13:28:21 +01:00
Enno
cff15cf40d
Docs: Source.repeat (and friends) (#28615) 2020-02-19 09:03:59 +01:00
Razvan Vacaru
bb895619b9
Docs: sink seq operator examples (#28616) 2020-02-17 10:26:53 +01:00
Johan Andrén
0cd63b7996
Push that TlsSpec timeout a bit up (#28591)
Trying to fix failures #28449 and #25858
2020-02-12 22:12:37 +01:00
eyal farago
ccd8481fec
stream: add flatMapPrefix operator (#28380) 2020-02-05 15:37:27 +01:00
Johannes Rudolph
a01dfa6201
stream: remove extra printStackTrace 2020-02-04 11:16:34 +01:00
Johannes Rudolph
1fbd1d338f
stream: fail eagerly during SubSink/SubSource materialization (#28492)
This way the stack trace will be more helpful because it contains the stage
that actually triggered the materialization.

Otherwise, we will only fail during `preStart` in the interpreter where the
stage will be failed and the error be propagated through the stream where
it can be hard to figure out what happened.

Also improve the message itself to contain the user provided name of the
sink/source.
2020-02-04 11:04:31 +01:00
Yakiv Yereskovskyi
a614f0bee7 allow Sink.queue concurrent pulling (#27352)
* allow Sink.queue concurrent pulling

* replace methods with default parameters on two overloaded methods to pass binary compatibility check :/

* replace ⇒ with =>

* reformat

* add javadsl

* fix PR comments and add concurrency to Sink.queue

* fix merge after auto resolving

* duplicate changes to javadsl

* revert source changes

* add graceful terminations

* clean up tests

* optimize imports

* trigger rebuild

* cover the case when materializer shutdown before async callbacks were processed

* vars to vals; fix require messages

* disable compatibility check for @InternalApi private[akka] class
2020-01-24 21:33:39 +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
Johan Andrén
fc0c98e17a
Support cancellation propagation in StreamRefs #28317 2020-01-20 10:28:26 +01:00
Mike Limansky
d9ed927df0 Update to ScalaTest 3.1.0, fix #28289. 2020-01-11 15:15:10 +03:00
Safta Catalin Mihai
6278968af5 Fix RetryFlow not stopping after maxRetries (#28443)
- the check for retryNo was pattern matching on tuple instead of any value
2020-01-03 21:07:19 +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
Brian Wignall
fd41299943 Fix typos, via a Levenshtein-style corrector 2019-12-19 01:57:55 -05:00
Patrik Nordwall
0008f1f400 Partition must not pull from closed in, #27189 2019-12-10 17:33:11 +01:00
Arnout Engelen
25ad10f893
Document asSubscriber stage (#28128)
* Unfortunately it seems the jdk9-only tests could not actually be compiled.
With these changes those can actually be compiled and ran again.

* Always link to jdk11 for java.* javadocs

* Update sbt-paradox-akka to fix linking to inner classes for javadoc
2019-12-05 16:40:05 +01:00
Jean-Baptiste Giraudeau
6d893fb571 Flow.delayWith allows custom delay for each element. (#25000) 2019-11-27 17:30:56 +01:00
Lim Chee Hau
571c7bd545 Include host and port in BindException message (#27785) (#27984) 2019-11-26 19:48:19 +01:00
Johan Andrén
d385c1098a
Operator docs for Source.combine (#28195) 2019-11-22 14:42:36 +01:00
Johan Andrén
a56a53734f Avoid deadlock on concurrent extension with materializer init (#28046)
* Avoid deadlock on concurrent extension with materializer init #28037

* Wrap blocking extension await with blocking context
2019-10-25 17:05:59 +01:00