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); }
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 )))); }
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 )))); }