Esempio n. 1
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
                                                            ))));
        }
Esempio n. 2
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);
        }