I am combing from django background where we use celery beats and celery for background tasks. Now, we have beats and timer which are two alien options for me.
However, after checking Internet Computer Loading I did not get the point from this. Because, my goal is to create websocket system using websocket gate to help many users communicate with each other.
Goal: I want to create a background task that runs 24/7. In which when user make some actions like Deposit ( I have and IC wallet where users can deposit and withdraw) I want to make a background task that check the deposit and update my data ( increate users balance) and send that to the gateway.
here is a pseudocode
async fn background_task(){
async fn onmessage(message) = {
STORE.get_user(message.user_id).set_balance(balance);
websocketgate.send({
channel : message.user_id,
new_balance: balance,
message: "Your deposit is successful",
});
}
websocketgate.onmessage = onmessage
}