@technogise/rn-background-queue-processor-realm-adapter
v1.0.1
Published
This package is designed for [rn-background-queue-processor](https://github.com/technogise/rn-background-queue-processor) to store Jobs in persistent Realm storage.
Downloads
5
Readme
React Native Queue Processor Realm Adapter
This package is designed for rn-background-queue-processor to store Jobs in persistent Realm storage.
Compatibility
Our current version works well for Realm: v5.0.3
Usage
Here is a working demo app
- Two schema are there to store all jobs and Failed jobs
- Job Schema contains all the Jobs ready for execution
- Failed Schema have all the failed jobs after queue execution
- Jobs are sent for execution according to its priority
Functions that are used in rn-background-queue-processor are -
addItem(job)
: Method to add a job in JobSchemaaddFailedItem(job)
: Method to add a job in FailedJobSchemaremove(jobId)
: Method to remove jobgetLength()
: Method to get lengthgetTopItem
: Method to get high priority JobgetAllItems
: To get all jobsgetJobInstance
: Method to get job instanceaddFailedItems
: Method to add failed jobs in JobSchema
Installation steps
npm i @technogise/rn-background-queue-processor-realm-adapter
Example import
import { RealmAdapter } from '@technogise/rn-background-queue-processor-realm-adapter';
constructor() {
const dbAdapter = new RealmAdapter(ExampleJob.prototype);
this.queue = new Queue(dbAdapter);
}