HipByte / Flow

Cross-platform libraries for RubyMotion
BSD 2-Clause "Simplified" License
141 stars 29 forks source link

Idea: thread pool library #5

Closed lrz closed 8 years ago

lrz commented 8 years ago

RubyMotion for iOS (and OS X) has the Dispatch module which wraps the libdispatch library, but RubyMotion for Android doesn't implement this module as the library doesn't exist there.

However, Android seems to offer a nice API to set up and use a thread pool: http://developer.android.com/training/multiple-threads/run-code.html http://developer.android.com/reference/java/util/concurrent/ThreadPoolExecutor.html

I suggest we add in Flow a simple library for thread pool execution, and that is implemented using Dispatch for iOS and ThreadPoolExecutor for Android.

Thoughts?

jjaffeux commented 8 years ago

Agreed.

lrz commented 8 years ago

I think a new API would be better, as the Dispatch API is pretty big and we don't want to implement all of it (for Android), also a "simpler" API would probably be better for Flow. I will come up with an API draft.

jjaffeux commented 8 years ago

@MarkVillacampa do you want to work on it ?

lrz commented 8 years ago

Done