4 ms·
That's an interesting concept. Would you also suggest having a way of saying "this method should execute in another thread" or "all of those methods should exec
by BinaryIdiot 9y ago
That's an interesting concept. Would you also suggest having a way of saying "this method should execute in another thread" or "all of those methods should execute in another thread"?
- bsaul 9y agoI'm still in the process of figuring how that would work. But mostly it would look something like annotation @threading("BACKGROUND_WORK_QUEUE_A") func someWork(data) {} @threading("BACKGROUND_WORK_QUEUE_A") func someSubWork(data) {} @threading("MAIN_QUEUE") func requestHandler() {} and you wouldn't be able to directly call someWork() from requestHandler() directly, but calling someSubWork() from someWork() would be fine. The idea is that i've observed that my code could often be split into parts running in their own threads, and the complex thread splitting code would be at the junction. Adding annotation like that would help me make sure that a function designed to run inside some part wouldn't accidentaly be called directly from another part.