我想用 for schedule 创建一个链接逻辑。访问令牌将每 1 小时获得一次。如果访问令牌成功,获取版本但是如果 version.HasNextVersion 为 false,访问令牌将继续。public async Task<string> GetAccessToken(){ /// getting token from server as async.}public async Task<string> GetVersions(string token){ // Web request as async var version = await GetVersionsFromServer(token); // if there are any other version after this version, I will get the next if(version.HasNextVersion) await GetVersions();}string Main(){ var accessToken = GetAccessToken().Wait(); var version = GetVersions(string token).Wait();}我是异步操作和任务库的新手。这可能吗?
2 回答
- 2 回答
- 0 关注
- 175 浏览
添加回答
举报
0/150
提交
取消