FAQ
#10
Replies: 2 comments 5 replies
-
I'm afraid this question is just about the code style. trait Consumer[F[_], A] extends Acker[F, A] with Receiver[F, A]
trait Receiver[F[_], A]:
def receiveM: Stream[F, Consumer.Msg[A]]
def receiveM(id: Consumer.MsgId): Stream[F, Consumer.Msg[A]]
def receive: Stream[F, A]
trait Acker[F[_], A]:
def ack(id: Consumer.MsgId): F[Unit]
def ack(ids: Set[Consumer.MsgId]): F[Unit]
def nack(id: Consumer.MsgId): F[Unit] I've seen sth similar here |
Beta Was this translation helpful? Give feedback.
2 replies
-
I'm struggling to understand how it is possible to run multiple instances of the processor service.
How does the sequenceDiagram
participant S as Snapshots
participant P as Pulsar
participant P1 as Processor1
participant P2 as Processor2
participant R as Redis
par processing 1
P1 -->>+ P1: start
P1 -->>+ R: read snapshot
R -->>- P1: snaphot
Note right of P1: stateVersion=x
loop every cmd
P -->> P1: trade cmd1
P1 -->> P1: apply cmd1 to state
Note left of P1: stateVersion=x+y
P1 -->>- P: trade event1 (cmd1 executed)
end
and processing 2
P2 -->>+ P2: start
P2 -->>+ R: read snapshot
R -->>- P2: snaphot
Note right of P2: stateVersion=x
loop every cmd
P -->> P2: trade cmd2
P2 -->> P2: apply cmd2 to state
Note left of P2: stateVersion=x+z
P2 -->>- P: trade event2 (cmd2 executed)
end
and snapshot writer
loop every ticky | event
alt event in
P -->>+ S: trade event1
S -->> S: apply cmd1 to state
Note right of S: stateVersion=x+y
S -->>- P: ack
P -->>+ S: trade event2
S -->> S: apply cmd2 to state
Note right of S: stateVersion=x+y+z???
S -->>- P: ack
else tick in
S -->>+ S: tick
S -->>+ R: write snapshot
R -->>- S: ack
end
end
end
What do I get wrong? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Q&A
Here's the place to ask general questions about the book, leave feedback, greetings, etc. If you have questions specific to a chapter, please refer to the chapter discussion instead.
FAQ
Where can I buy the digital version?
Single: https://leanpub.com/feda/
PFPS bundle: https://leanpub.com/b/pfp-feda-scala
Will there be a print version?
Yes, as soon as the digital version is 100% complete. Usually available on my Blurb account.
Where can I subscribe to updates?
Announcements will always be made in this discussion, you can subscribe there. Additionally, I usually make announcements on my Twitter account.
Book updates generally ship with release notes, which you can get via email, if you're subscribed to LeanPub updates.
Beta Was this translation helpful? Give feedback.
All reactions