예제 #1
0
        public LanguageExt.Unit SetData(long time, SessionId sessionId, string key, object value)
        {
            var added = false;

            Sync.SetData(sessionId, key, value, time);

            cluster.Iter(c =>
            {
                added = c.HashFieldAddOrUpdateIfKeyExists(SessionKey(sessionId), key, SessionDataItemDTO.Create(value));

                if (added && key == SupplementarySessionId.Key && value is SupplementarySessionId supp)
                {
                    SupplementarySessionManager.setSuppSessionInSuppMap(c, sessionId, supp);
                }
            });

            return(added
                   ? cluster.Iter(c =>
                                  c.PublishToChannel(SessionsNotify,
                                                     SessionAction.SetData(
                                                         time,
                                                         sessionId,
                                                         key,
                                                         value,
                                                         system,
                                                         nodeName)))
                   : unit);
        }
예제 #2
0
        public LanguageExt.Unit SetData(long time, SessionId sessionId, string key, object value)
        {
            Sync.SetData(sessionId, key, value, time);
            cluster.Iter(c => c.HashFieldAddOrUpdate(SessionKey(sessionId), key, SessionDataItemDTO.Create(value)));

            return(cluster.Iter(c => c.PublishToChannel(SessionsNotify, SessionAction.SetData(
                                                            time,
                                                            sessionId,
                                                            key,
                                                            value,
                                                            system,
                                                            nodeName
                                                            ))));
        }
예제 #3
0
        public LanguageExt.Unit SetData(long time, SessionId sessionId, string key, object value)
        {
            Sync.SetData(sessionId, key, value, time);
            cluster.Iter(c => c.HashFieldAddOrUpdate(SessionKey(sessionId), key, value));

            return(cluster.Iter(c => c.PublishToChannel(SessionsNotify, SessionAction.SetData(
                                                            time,
                                                            sessionId,
                                                            key,
                                                            JsonConvert.SerializeObject(value, ActorSystemConfig.Default.JsonSerializerSettings),
                                                            system,
                                                            nodeName
                                                            ))));
        }