Skip to content

Actor model on top of cats? #2627

Answered by armanbilge
yatesco asked this question in Q&A
Dec 4, 2021 · 6 comments · 10 replies
Discussion options

You must be logged in to vote

I arrived to CE3 from Akka world, so I also had a hard time wrapping my head around this one at first :) still do sometimes!

How do you manage long running, independant, but identifiable processes? A process per session on a web server for example, or a process per long running async something or other.

Yes, fibers are indeed the answer. They are lightweight and generally awesome!

why doesn't this already exist - I must be missing something

It is fairly straightforward to make an "actor" using fs2's Channel API.

trait Channel[F[_], A] {
  def send(a: A): F[Either[Channel.Closed, Unit]]
  def stream: Stream[F, A]
}

https://github.com/typelevel/fs2/blob/main/core/shared/src/main/scala/f…

Replies: 6 comments 10 replies

Comment options

You must be logged in to vote
5 replies
@yatesco
Comment options

@armanbilge
Comment options

@SystemFw
Comment options

@SystemFw
Comment options

@yatesco
Comment options

Answer selected by yatesco
Comment options

You must be logged in to vote
1 reply
@bblfish
Comment options

Comment options

You must be logged in to vote
1 reply
@yatesco
Comment options

Comment options

You must be logged in to vote
2 replies
@SystemFw
Comment options

@bblfish
Comment options

This comment was marked as spam.

Comment options

You must be logged in to vote
1 reply
@yatesco
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
6 participants