/// <summary> /// Attempts to pull the global configuration, and begins continuous polling of timing and local SD configuration. /// A connection to the database must have been initialized via Connect(). /// </summary> /// <param name="shardCoords"></param> /// <param name="numTries"></param> public static bool BeginPullConfig(Int3 shardCoords, int numTries = 3) { bool rs = TryPullGlobalConfig(numTries); { var poller = new ContinuousPoller <TimingContainer>(new TimingContainer(), (collection) => null); TimingPoller = poller; poller.Start(ControlStore, TimingID); } { var poller = new ContinuousPoller <SDConfigContainer>(new SDConfigContainer(), (collection) => null); SDConfigPoller = poller; poller.Start(ControlStore, "SD_" + shardCoords.Encoded); } return(rs); }
public void BeginFetch(DataBase store, K id) { lock (this) { if (requests.ContainsKey(id)) { return; } if (store == null) { return; } ContinuousPoller <D> poller = new ContinuousPoller <D>(null, m); if (!requests.TryAdd(id, poller)) { return; } poller.Start(store, id.ToString()); } }