Ejemplo n.º 1
0
        public Pupindra(string connectionString)
        {
            _queue = new PushQueue <PrescencePushData>(connectionString, PushMessageType.PresenceService);

            t_ = Task.Run(async() =>
            {
                var tm = DateTime.Now;
                while (true)
                {
                    await Task.Delay(1000);
                    foreach (var st in users.Values)
                    {
                        st.dummy    = DateTime.UtcNow.Second;
                        st.version += 1;
                        if (st.tk != null)
                        {
                            _queue.Enqueue(st.tk, new PrescencePushData()
                            {
                                Dummy = st.dummy, Version = st.version, Kuku = $"Kuku {DateTime.UtcNow}"
                            });
                        }
                    }
                }
            });
        }
Ejemplo n.º 2
0
 public IHttpActionResult Enqueue(AnuntDto anunt)
 {
     PushQueue.Enqueue(anunt);
     return(Ok());
 }