Sign in
Log inSign up
Pierre Ricadat

21 likes

·

3.7K reads

9 comments

Elvis Lee
Elvis Lee
Aug 7, 2024

Hi, For the ZPure type W, you mentioned "I've used it for storing events in an event sourcing application, for feeding a stream of messages to players in a game, but also for storing actual logs" Isn't logging or firing events a side effect? And should no be in ZPure?

1
·
·2 replies
Pierre Ricadat
Pierre Ricadat
Author
·Aug 7, 2024

That's right, but in the ZPure layer I only accumulate them. After running the ZPure, if the program was successful only then I actually log them or do something with them.

1
·
Elvis Lee
Elvis Lee
Aug 7, 2024

I See, Thank you :)

·
David K.
David K.
Aug 10, 2024

Thank you for this insightful review of stacked technologies. But I still wonder if guilds are contained in one server but other things are not. I guess the ZIO effect code needs to access multiple guilds from different servers. How do you solve this communication issue?

1
·
Elvis Lee
Elvis Lee
Aug 16, 2024

Very Interesting, but I am still confused... If Shardcake entity handling messages one at a time, just like Akka actor does. Why do you need to handle race condition?

·
·3 replies
Pierre Ricadat
Pierre Ricadat
Author
·Aug 17, 2024

This allows you to handle the actor messages in parallel instead of sequentially (e.g. using mapZIOPar or just forking each message handling). Now depending on the use case that may or may not be desirable. If there would be a lot of contention (each request handling accessing the same objects), sequentially is probably better. In that case you can still use the ZIO/ZPure separation and skip the ZSTM layer. In my use cases (games), we often want to respond to client requests ASAP so parallelizing is better.

1
·
Elvis Lee
Elvis Lee
Aug 17, 2024

Thank you for the comprehensive explanation. I learned a lot. Much appreciated.

·
Eka Intan
Eka Intan
·