<@U3U4CUGDR> see the above thread, this code is br...
# coroutines
u
@zokipirlo see the above thread, this code is broken no matter if contains is thread safe or not. think about this scenario:
Copy code
launch(ioContext) {
	if (!mutableList.contains(something)) {
		modifyActor.send(Add(something))
	}
}
launch(ioContext) {
// Actor has not yet processed the 'Add' message, because it was busy processing other requests
	if (mutableList.contains(something)) {
		//We will not get here
		modifyActor.send(Remove(something))
	}
}
z
Yes, that's true. Remove would be lost. Will change implementation to two lists, where I will just add things (added and remove things). In worst case scenario it would send message to actor multiple times, but will be processed only once.
Thanks!