public Task <string> GetAsync(long key) { if (!this.lockSet.Contains(key)) { this.locations.TryGetValue(key, out string location); return(Task.FromResult(location)); } LocationQueryTask task = new LocationQueryTask(key); this.AddTask(key, task); return(task.Task); }
public Task <int> GetAsync(long key) { if (!this.lockDict.ContainsKey(key)) { this.locations.TryGetValue(key, out int location); //Log.Info($"location get key: {key} {location}"); return(Task.FromResult(location)); } LocationQueryTask task = new LocationQueryTask(key); this.AddTask(key, task); return(task.Task); }