Search in sources :

Example 1 with Configuration

use of com.path.android.jobqueue.config.Configuration in project android-priority-jobqueue by path.

the class TwitterApplication method configureJobManager.

private void configureJobManager() {
    Configuration configuration = new Configuration.Builder(this).customLogger(new CustomLogger() {

        private static final String TAG = "JOBS";

        @Override
        public boolean isDebugEnabled() {
            return true;
        }

        @Override
        public void d(String text, Object... args) {
            Log.d(TAG, String.format(text, args));
        }

        @Override
        public void e(Throwable t, String text, Object... args) {
            Log.e(TAG, String.format(text, args), t);
        }

        @Override
        public void e(String text, Object... args) {
            Log.e(TAG, String.format(text, args));
        }
    }).minConsumerCount(// always keep at least one consumer alive
    1).maxConsumerCount(// up to 3 consumers at a time
    3).loadFactor(// 3 jobs per consumer
    3).consumerKeepAlive(// wait 2 minute
    120).build();
    jobManager = new JobManager(this, configuration);
}
Also used : Configuration(com.path.android.jobqueue.config.Configuration) CustomLogger(com.path.android.jobqueue.log.CustomLogger) JobManager(com.path.android.jobqueue.JobManager)

Aggregations

JobManager (com.path.android.jobqueue.JobManager)1 Configuration (com.path.android.jobqueue.config.Configuration)1 CustomLogger (com.path.android.jobqueue.log.CustomLogger)1