How do I use the Main dispatcher if my platform is...
# coroutines
c
How do I use the Main dispatcher if my platform isn't Android?
e
What's your UI framework?
c
I'm not using a UI
e
Then you don't have Main dispatcher.
(nor need one)
c
:C
Concurrent modification issues tho
e
Don't share mutable state. No issues
(don't make mistake UI frameworks do)
c
I'm just adding something to my eventbus
e
Isn't your eventbus thread-safe?
c
Ummmm, not currently lol
e
That's a bad event bus
c
;-;
e
c
Thank you :3
Unfortunately after giving it a read, I don't think it helped me very much idea wise. The only thing I got that seems useful is Mutex for the situation I have run in. Anything else I can read @elizarov?
e
It really depends on what you are trying to achieve
c
I want to add multithreading/coroutine support to my eventbus
Which at the moment, just seems to be an issue with concurrently adding a value to the list
e
You might want to learn more about concurrency, first. "Java Concurrency in Practice" is a good book I can recommend.
c
Alright
e
As for coroutines, the easiest thing (that would not require any sharing of mutable state) is to represent your eventbus as an actor, that is confine all its operations to a single coroutine.
c
Ooo, alright. I'll read up on actors :3
d
@elizarov Do you suggest using actor coroutines as the event bus for a multiplatform application?