/// <summary> /// set this process's id gen work and datacenter /// ensure that this method invoked before all the calls /// otherwise it's not work /// </summary> public static void Init(long workerID, long datacenter) { if (_iDWorker == null) { _iDWorker = new IDGen(workerID, datacenter); } }
public static IDGen GetInstance(long workerID = 12L, long datacenter = 12L) { if (_iDWorker == null) { _iDWorker = new IDGen(workerID, datacenter); } return(_iDWorker); }