public static ID Generate()
        {
            if (RemoteDownstreamConfig.Agent.ApplicationId == DictionaryUtil.NullValue)
            {
                throw new InvalidOperationException();
            }

            IDContext context = threadIdSequence.Value;

            return(new ID(
                       RemoteDownstreamConfig.Agent.ApplicationInstanceId,
                       Thread.CurrentThread.ManagedThreadId,
                       context.NextSeq()
                       ));
        }
Esempio n. 2
0
        public static ID Generate()
        {
            if (!RuntimeEnvironment.Instance.ServiceInstanceId.HasValue)
            {
                throw new InvalidOperationException();
            }

            IDContext context = threadIdSequence.Value;

            return(new ID(
                       RuntimeEnvironment.Instance.ServiceInstanceId.Value,
                       Thread.CurrentThread.ManagedThreadId,
                       context.NextSeq()
                       ));
        }