stanfy / goro Goto Github PK
View Code? Open in Web Editor NEWAndroid library for organizing your asynchronous tasks in queues
License: Apache License 2.0
Android library for organizing your asynchronous tasks in queues
License: Apache License 2.0
So that we can schedule an Observable
work on Goro
queue with scheduleOn
or subscribeOn
.
It will allow to choose whether you want to use the main Goro instance directly (in a syncadapter, for example), or use something like BoundGoro
in an Activity to pass jobs to the service context.
Proposal.
Queues can be visualized
name | processing | line
-----------------------------------------------
queue1 | task3 | task1 <- task2
queue2 | task10 | task43 <- task42 <- task0
We can dump the state with goro.dump(Writer)
.
Also there is a Dumper implements GoroListener
that dumps the state whenever task is added/started/finished.
GoroService
has static setDebug(true|false)
method that leads to registering Dumper
in debug mode.
Main goals:
bindOneshot()
Current Goro
implementation heavily relies on the fact that GoroService
is in the same process.
The check here:
https://github.com/stanfy/goro/blob/v3.0.0-RC3/goro/src/main/java/com/stanfy/enroscar/goro/Goro.java#L26
which is invoked here:
https://github.com/stanfy/goro/blob/v3.0.0-RC3/goro/src/main/java/com/stanfy/enroscar/goro/BoundGoro.java#L61
is required to obtain Goro
instance from GoroService
, which, in fact, was plugged in using GoroService.setup
method.
But BoundGoro
should send tasks to the GoroService
, instead.
P.S. Currently, the only purpose of GoroService
is to keep application alive, because it does not provide any IPC functions - it operates on the same Goro
which was provided during setup.
BoundGoroImpl
uses onServiceConnected
which is always called in MainThread
by Android. In the same time, schedule(...)
could be called from any thread. And in case bindOneshot
onServiceConnected
could be called even before schedule
puts future
into postponed
- in this case, future would never start.
Quick ugly fix is here almozavr@76a17c8 - I think it's no good to be merged into library, but I want to start a discussion.
Provide .idea/codeStyleSettings.xml
for easier contribution as there is non-default formatting.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.