How to run the Eval method in each instance of a class from the list, in such a way that each instance works without blocking the others - as if in a different thread, or as a coroutine?
1) There is a calculator class (Script interpreter-compiler)
B4X:
' classTask --> Class Script Evaluator'
Sub Process_Globals
Public Taskname as string
Public TaskStatus as int
End Sub
Public Sub Initializi(script as string)
'....
End Sub
'begin evaluate
Public Sub Eval()
'....
End Sub
' Get my mail
Public Sub GetMail(mail as object)
'.....
End Sub
2) There is a list of active tasks in the Map form:
B4X:
Sub Process_Globals
private ActiveTask as map ' task list
End Sub
Sub Service_Create
ActiveTask.Initialze
End Sub
' Add and Run
Public AddNewActiveTask(task as classTask)
ActiveTask.Add(task.Name, task)
'Parallel RUN ---> ActiveTask.Get(name).Eval.
'???????
End Sub
1) There is a calculator class (Script interpreter-compiler)
B4X:
' classTask --> Class Script Evaluator'
Sub Process_Globals
Public Taskname as string
Public TaskStatus as int
End Sub
Public Sub Initializi(script as string)
'....
End Sub
'begin evaluate
Public Sub Eval()
'....
End Sub
' Get my mail
Public Sub GetMail(mail as object)
'.....
End Sub
2) There is a list of active tasks in the Map form:
B4X:
Sub Process_Globals
private ActiveTask as map ' task list
End Sub
Sub Service_Create
ActiveTask.Initialze
End Sub
' Add and Run
Public AddNewActiveTask(task as classTask)
ActiveTask.Add(task.Name, task)
'Parallel RUN ---> ActiveTask.Get(name).Eval.
'???????
End Sub