本文整理汇总了Java中com.path.android.jobqueue.Job类的典型用法代码示例。如果您正苦于以下问题:Java Job类的具体用法?Java Job怎么用?Java Job使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Job类属于com.path.android.jobqueue包,在下文中一共展示了Job类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: jobManager
import com.path.android.jobqueue.Job; //导入依赖的package包/类
@Provides
@Singleton
public JobManager jobManager() {
Configuration config = new Configuration.Builder(mApp)
.consumerKeepAlive(45)
.maxConsumerCount(3)
.minConsumerCount(1)
.customLogger(L.getJobLogger())
.injector(new DependencyInjector() {
@Override
public void inject(Job job) {
if (job instanceof BaseJob) {
((BaseJob) job).inject(mApp.getAppComponent());
}
}
})
.build();
return new JobManager(mApp, config);
}
示例2: prepare
import com.path.android.jobqueue.Job; //导入依赖的package包/类
public static TestComponent prepare(App app) {
FlowManager.destroy();
resetSingleton(FlowManager.class, "mDatabaseHolder");
ApplicationModule appModule = new ApplicationModule(app) {
@Override
public EventBus eventBus() {
return new LoggingBus();
}
@Provides
@Singleton
public JobManager jobManager() {
JobManager mock = mock(JobManager.class);
when(mock.addJob(any(Job.class))).thenReturn(1L);
return mock;
}
};
TestComponent testComponent = DaggerTestComponent.builder()
.testApplicationModule(new TestApplicationModule())
.applicationModule(appModule)
.build();
testComponent.appContext().deleteDatabase(DemoDatabase.NAME + ".db");
FlowManager.init(app);
testComponent.feedModel().clear();
testComponent.loggingBus().clear();
return testComponent;
}
示例3: interactorToJob
import com.path.android.jobqueue.Job; //导入依赖的package包/类
private Job interactorToJob(Interactor interactor, InteractorPriority priority) {
Params params = new Params(priority.getPriorityValue());
return new InteractorJobImp(params, interactor);
}