예제 #1
0
        void on_put_record(Message m)
        {
            var ur = new UserRecord(m);

            ur.set_deadline_from_now((long)config_.recordMaxBufferedTime);
            ur.set_expiration_from_now((long)config_.recordTtl);

            var stream   = ur.Stream();
            var pipeline = GetPipeline(stream);

            pipeline.put(ur);
        }
예제 #2
0
        void retry_not_expired(UserRecord ur, DateTime start, DateTime end, string err_code, string err_msg)
        {
            ur.add_attempt(new Attempt().set_start(start).set_end(end).set_error(err_code, err_msg));

            if (ur.expired())
            {
                fail(ur, DateTime.Now, DateTime.Now, "Expired", "Record has reached expiration");
            }
            else
            {
                // TimeSensitive automatically sets the deadline to the expiration if the given deadline is later than the expiration.
                ur.set_deadline_from_now((long)config_.recordMaxBufferedTime / 2);
                retry_cb_(ur);
            }
        }