JobQueue

persisted job queue for android

License

License

GroupId

GroupId

com.tomergoldst.android
ArtifactId

ArtifactId

jobqueue
Last Version

Last Version

2.0.1
Release Date

Release Date

Type

Type

aar
Description

Description

JobQueue
persisted job queue for android
Project URL

Project URL

https://github.com/tomergoldst/job-queue
Source Code Management

Source Code Management

https://github.com/tomergoldst/job-queue

Download jobqueue

How to add to project

<!-- https://jarcasting.com/artifacts/com.tomergoldst.android/jobqueue/ -->
<dependency>
    <groupId>com.tomergoldst.android</groupId>
    <artifactId>jobqueue</artifactId>
    <version>2.0.1</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.tomergoldst.android/jobqueue/
implementation 'com.tomergoldst.android:jobqueue:2.0.1'
// https://jarcasting.com/artifacts/com.tomergoldst.android/jobqueue/
implementation ("com.tomergoldst.android:jobqueue:2.0.1")
'com.tomergoldst.android:jobqueue:aar:2.0.1'
<dependency org="com.tomergoldst.android" name="jobqueue" rev="2.0.1">
  <artifact name="jobqueue" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.tomergoldst.android', module='jobqueue', version='2.0.1')
)
libraryDependencies += "com.tomergoldst.android" % "jobqueue" % "2.0.1"
[com.tomergoldst.android/jobqueue "2.0.1"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

JobQueue

Persisted job queue for android.

Manage your jobs flow by working with a queue. You can create as many queues as you need

Light and easy to use

Dependency

Add a dependency to your app build.gradle

dependencies {
    compile 'com.tomergoldst.android:jobqueue:2.0.1'
}

Instructions

Init JobQueue at your application class onCreate()

public class MyApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();

        JobQueue.initialize(this);
    }
}

add a job to queue:

final String NETWORK_QUEUE = "network_queue"
JobTask jobTask = new JobTask("myJobName", "myJobData")
JobQueue.add(NETWORK_QUEUE, jobTask);

pop next job:

JobTask jobTask = JobQueue.pop(NETWORK_QUEUE);

peek on next job:

JobTask jobTask = JobQueue.peek(NETWORK_QUEUE);

remove job from queue:

JobQueue.remove(jobTask);

remove all jobs from queue:

JobQueue.clearQueue(NETWORK_QUEUE);

get all jobs on queue:

List<JobTask> jobs = JobQueue.getJobs(NETWORK_QUEUE);

get all jobs of the same task on queue:

List<JobTask> jobs = JobQueue.getJob(NETWORK_QUEUE, "myJobName");

get queue size:

long size = JobQueue.size(NETWORK_QUEUE);

License

Copyright 2019 Tomer Goldstein

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Versions

Version
2.0.1