假设我有一些类似的代码:
let offlineRequest = OfflineRequest(params: ["id": summaryId], apiAction: ApiAction.deleteSummary)
let offlineRequestsStore = ApplicationManager.instance().offlineRequestsStore
offlineRequestsStore.storeRequest(offlineRequest: offlineRequest) // a call with adding one more request but which call other async function to decrease RequestStore.pendingRequestInQueue() count when the call to the server is executed.
let offlineRequests = RequestStore.pendingRequestInQueue() // Does this code make any senese? Could this line be called simultaneouslywith with the line above assuming it has async call in it?
if offlineRequests {
self.presenter?.updateHistoryDataSource()
} else {
self.getHistoryWorkouts()
}
我想了解其执行操作(任务)的时间表
例如,如果我有下一行代码
第1行。主线程中的函数调用
第2行。异步中的func调用
第3行。主线程中的func调用
假设在同时调用第3行时,第2行从异步线程返回,将在第2行之前执行第3行?
我的意思是主线程在时间轴上具有某些优先级,或者可以同时执行两个任务,并且主线程上的第3行将检查结果是否可以更改?
假设我有一些代码,例如:let offlineRequest = OfflineRequest(params:[“ id”:summaryId],apiAction:ApiAction.deleteSummary)let offlineRequestsStore = ApplicationManager.instance()。...
将在第2行之前执行第3行