Пример #1
0
        private IReliableDictionary <string, byte[]> GetReminderDictionary(ActorId actorId)
        {
            var bytes      = Encoding.UTF8.GetBytes(actorId.GetStorageKey());
            var storageIdx = CRC64.ToCRC64(bytes) % (ulong)this.reminderDictionaries.Length;

            return(this.reminderDictionaries[storageIdx]);
        }
 internal static string CreateReminderCompletedStorageKeyPrefix(ActorId actorId)
 {
     return(string.Format(
                CultureInfo.InvariantCulture,
                "{0}_{1}_",
                ReminderCompletedStorageKeyPrefix,
                actorId.GetStorageKey()));
 }
 internal static string CreateActorPresenceStorageKey(ActorId actorId)
 {
     return(string.Format(
                CultureInfo.InvariantCulture,
                "{0}_{1}",
                ActorPresenceStorageKeyPrefix,
                actorId.GetStorageKey()));
 }
Пример #4
0
        private static string CreateStorageKeyPrefix(ActorId actorId, string keyPrefix = null)
        {
            if (string.IsNullOrEmpty(keyPrefix))
            {
                return(string.Format(CultureInfo.InvariantCulture, "{0}_", actorId.GetStorageKey()));
            }

            return(CreateStorageKey(actorId, keyPrefix));
        }
        internal static string CreateActorPresenceStorageKey(ActorId actorId)
        {
            if (actorId == null)
            {
                throw new ArgumentNullException(nameof(actorId));
            }

            return(string.Format(CultureInfo.InvariantCulture, "{0}_{1}", "@@", actorId.GetStorageKey()));
        }
 internal static string CreateReminderCompletedStorageKey(ActorId actorId, string reminderName)
 {
     return(String.Format(
                CultureInfo.InvariantCulture,
                "{0}_{1}_{2}",
                ReminderCompletedStorageKeyPrefix,
                actorId.GetStorageKey(),
                reminderName));
 }
Пример #7
0
 private static string CreateStorageKey(ActorId actorId, string stateName)
 {
     Requires.Argument("stateName", stateName.Trim()).NotNullOrEmpty();
     return(string.Format(CultureInfo.InvariantCulture, "{0}_{1}", actorId.GetStorageKey(), stateName));
 }
 private static string CreateReminderStorageKey(ActorId actorId, string reminderName)
 {
     return(string.Format(CultureInfo.InvariantCulture, "{0}_{1}_{2}", ReminderKeyPrefix, actorId.GetStorageKey(), reminderName));
 }