Comments (4)
# uname -a
Linux 5.15.0-79-generic #86~20.04.2-Ubuntu SMP Mon Jul 17 23:27:17 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
# mkfifo /tmp/pipe
ammonite (Ammonite Repl 2.5.4 (Scala 2.13.8 Java 11.0.5)):
import $ivy.`com.typesafe.akka::akka-stream:2.6.19`
import akka.stream._
import akka.stream.scaladsl._
import java.nio.file.{Paths, Files}
import akka.actor.ActorSystem
implicit val as = ActorSystem("Pipe")
implicit val ec = scala.concurrent.ExecutionContext.global
val f = FileIO.fromPath(Paths.get("/tmp/pipe")).to(Sink.foreach{println}).run()
Push data:
echo "1" >/tmp/pipe
[ERROR] [09/27/2023 11:51:00.173] [Pipe-akka.actor.default-blocking-io-dispatcher-8] [akka://Pipe/system/Materializers/StreamSupervisor-0/flow-0-1-fileSource] Error during preStart in [akka.stream.impl.io.FileSource$$anon$2-fileSource]: Nicht erlaubter Seek
java.io.IOException: Nicht erlaubter Seek
at java.base/sun.nio.ch.FileDispatcherImpl.seek0(Native Method)
at java.base/sun.nio.ch.FileDispatcherImpl.seek(FileDispatcherImpl.java:78)
at java.base/sun.nio.ch.FileChannelImpl.position(FileChannelImpl.java:361)
at akka.stream.impl.io.FileSource$$anon$2.preStart(IOSources.scala:74)
at akka.stream.impl.fusing.GraphInterpreter.init(GraphInterpreter.scala:306)
at akka.stream.impl.fusing.GraphInterpreterShell.init(ActorGraphInterpreter.scala:619)
at akka.stream.impl.fusing.ActorGraphInterpreter.tryInit(ActorGraphInterpreter.scala:727)
at akka.stream.impl.fusing.ActorGraphInterpreter.preStart(ActorGraphInterpreter.scala:776)
at akka.actor.Actor.aroundPreStart(Actor.scala:548)
at akka.actor.Actor.aroundPreStart$(Actor.scala:548)
at akka.stream.impl.fusing.ActorGraphInterpreter.aroundPreStart(ActorGraphInterpreter.scala:716)
at akka.actor.ActorCell.create(ActorCell.scala:644)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:514)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:536)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:295)
at akka.dispatch.Mailbox.run(Mailbox.scala:230)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
from akka.
If you can share a reproducer or clear steps to reproduce that would be useful @syspulse
from akka.
In the FileSource we always read with a position, but that is not supported at all with fifos, additionally, opening a fifo with FileChannel.open
will block the thread until there is a write on the other side.
I think we should detect fifos passed to it and fail early saying it is not supported. To stream from a fifo there would need to be a special stream source, but this is the first time I have seen anyone talking about it so it is unlikely to be something we add in core akka streams.
from akka.
For the record a workaround would be to consume the fifo with a FileInputStream
and adapt to stream using StreamConverters.fromInputStream
(which expects and handles that the interactions are blocking)
from akka.
Related Issues (20)
- Actor system cannot be terminated when scheduling 0 delay task HOT 1
- Stackoverflow in ByteString HOT 2
- Feature request: Add more `onErrorXXX` stream operators
- sbt-publish-rsync not on maven central yet (the last one! ;) HOT 2
- Failed: akka.cluster.sharding.typed.ShardedDaemonProcessRescaleSpec
- [doc] Stream Fan In/Out operator missing applied component HOT 1
- Circuit breaker registry usage requires ExtendedActorSystem
- Simplify flight recorder interactions HOT 1
- No way to signal no change with ChangeEventHandler HOT 2
- Pattern based publish for topics/service keys
- Set Jackson USE_PROPERTIES_BASED to no longer need @JsonCreator HOT 2
- failed: Native image tests - NoSuchElementException HOT 1
- AskPattern won't use`refPrefix` sometime. HOT 1
- Release 2.9.2
- Soften language used about service meshes with Akka in documentation HOT 1
- cannot find symbol symbol: class Greet HOT 8
- Support PKCS8 and ECDSA HOT 3
- failed: EventSourcedBehaviorRetentionSpec HOT 5
- Issue with rending DurableState docs on how to write custom plugin
- Document how to test DurableState using testkit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from akka.