ursus
04/11/2020, 7:32 PMZach Klippenstein (he/him) [MOD]
04/13/2020, 5:30 PMvalue and accept on a BehaviorRelay from multiple threads just fine.
However if you call your newJobs = … update logic from multiple threads concurrently, there’s a race and your set could lose items. This can happen because both threads can read the relay’s value at the same time, each add their own `downloadJob`s, and then the first one to call accept will get overwritten by the second one.Zach Klippenstein (he/him) [MOD]
04/13/2020, 5:30 PMMutex), then it should be safe.ursus
04/13/2020, 6:33 PMursus
04/13/2020, 6:35 PMAll methods except accept(T) are thread-safe. Use toSerialized() to make it thread-safe as well.ursus
04/13/2020, 6:35 PMZach Klippenstein (he/him) [MOD]
04/13/2020, 11:02 PMursus
04/13/2020, 11:32 PM