Wish Add remove polling method

santook

Member
We often use the addloop method, but we find that this method can only add, and does not detect duplication.
When we use AddLoop ("Run") two times, the Run method may be repeated.
It is suggested that addloop be added to check the function address. For duplicate address, it should not be added to the loop.
In addition, it is better to add a removeloop method, which can check the method with the same address in the queue and delete it from the queue.

For example:

B4X:
public Sub InitNetwork
    AddLooper("Task1")
End Sub

Public Sub Task1
    Network.Run
    If NetWork.Disconnected Then
        RemoveLoop("Task1")
    End If
End Sub
 
Top