How to execute a specifc job after some time interval like 5 minutes? I want to perform a job after 5 minute, I explain what I mean with an example:

"I connect to bank gateway, register my order there,they give me transactionId and told me  I should verify transaction after 5 minute,

I wrote register (register_my_order) and verification (verfiy_myorder) code, but I want set interval 5 minute between them.
My Pseudocode:

transctionId= register_my_order(myorder)
delay(5minute)
verfiy_myorder(transctionId)


One of my solution was using rule scheduler (a sub-module of Rules), 

I try below solution but not worked


Create a rule component and get transctionId as parameter
In action run my verfication fuction with provided parameter as transction Id


then in my code between register_my_order(myorder)  and verfiy_myorder(transctionId) I create  rule task schedule with below code

    //$result = rules_invoke_component('rules_run_after_5_minute', 'param1');
     $state = new RulesState();
    $state-&gt;addVariable('tref', 'test', array()); //tref is name of parameter and test is passed parameter to it 
    // 3rd parameter is called $info it must be an array, but i don't know it's function
   $task = array(
    'date' =&gt; time(), // timestamp
    'config' =&gt; 'rules_run_after_5_minute', // it is my component machine name
    'state' =&gt; $state,
);

$result=rules_scheduler_schedule_task($task);


any idea that how can I create task schedule programmatically and work correctly ( my code create it but not getting  run  )
Using the "Rules Scheduler" sub-module of the Rules module seems indeed a possible approach.

However, be aware that the actual trigger wil only happen the next time your Cron job runs, similar to what's mentioned in the question about "Is there anyway to get more control over when CRON runs?". Maybe that's what the missing part is that you're looking for?

So at least as a way to check if the logic of your code is running as you want, try to trigger running your cron job from the admin panels. If that's how such check is performed at least 1 time, then your question is like simplified similar to the question I referred to in my link above.

PS: I don't it says in your question (correct me if I missed it), but if the first time your "verify order" indicates that the verify didn't pass yet, make sure to reschedule the same rule to be executed 5 minutes later on also.