Queueable Jobs
1. These are asynchronous jobs.
2. To implement the operation of queueable, we have to implement the interface of Queueable.
3. Any class that implements Queueable Interface has to define execute method.
4. The job that need to be implemented has to be designed with in execute method.
5. If you want to schedule the jobs we have to use System.enqueueJob.
Ex:
public class QueueExample implements Queueable{
public void execute(QueueableContext context){
Account a=new Account(Name='AccName', Phone =' 12345');
insert a;
}
}
in Debug
System.enqueueJob(new QueueExample());
QueueExample queEx=new QueueExample();
system.enqueuejob(queEx);
Comments
Post a Comment