Files
MaxScale/server/core
Johan Wikman be9504ac94 MXS-1754 Add possibility to cancel delayed calls
The interface for canceling calls is now geared towards the needs
of sessions. Basically the idea is as follows:

class MyFilterSession : public maxscale::FilterSession
{
    ...
    int MyFilterSession::routeQuery(GWBUF* pPacket)
    {
       ...
       if (needs_to_be_delayed())
       {
           Worker* pWorker = Worker::current();
           void* pTag = this;
           pWorker->delayed_call(5000, pTag, this,
                                 &MyFilterSession::delayed_routeQuery,
                                 pPacket);
           return 1;
       }
       ...
    }

    bool MyFilterSession::delayed_routeQuery(Worker::Call:action_t action,
                                             GWBUF* pPacket)
    {
        if (action == Worker::Call::EXECUTE)
        {
            routeQuery(pPacket);
        }
        else
        {
            ss_dassert(action == Worker::Call::CANCEL);
            gwbuf_free(pPacket);
        }
        return false;
    }

    ~MyFilterSession()
    {
        void* pTag = this;
        Worker::current()->cancel_delayed_calls(pTag);
    }
}

The alternative, returning some key that the caller must keep
around seems more cumbersome for the general case.
2018-04-23 13:58:00 +03:00
..
2018-04-10 15:29:29 +03:00
2018-03-15 23:23:15 +02:00
2017-06-01 10:24:20 +03:00
2017-11-22 18:40:18 +02:00
2018-04-10 15:30:28 +03:00
2017-06-01 10:24:20 +03:00
2017-11-22 18:40:18 +02:00
2018-03-20 13:07:27 +02:00
2017-06-01 10:24:20 +03:00
2017-06-01 10:24:20 +03:00
2017-11-22 18:40:18 +02:00
2017-11-22 18:40:18 +02:00
2017-10-02 16:08:12 +03:00
2018-02-08 13:40:11 +02:00
2018-01-05 09:58:10 +02:00
2017-11-22 18:40:18 +02:00
2017-12-27 11:56:39 +02:00
2017-11-22 18:40:18 +02:00
2017-11-22 18:40:18 +02:00
2018-04-13 14:53:00 +03:00
2018-01-30 16:28:11 +02:00
2018-03-12 14:38:37 +02:00
2017-06-01 10:24:20 +03:00
2018-04-16 14:53:08 +03:00
2017-11-22 18:40:18 +02:00
2017-06-01 10:24:20 +03:00
2017-06-01 10:24:20 +03:00
2017-06-01 10:24:20 +03:00
2017-11-22 18:40:18 +02:00
2018-04-17 22:17:34 +03:00
2018-01-05 09:58:10 +02:00
2017-06-01 10:24:20 +03:00
2017-11-21 16:49:21 +02:00
2017-11-22 18:40:18 +02:00
2018-02-02 16:05:14 +02:00
2017-11-22 18:40:18 +02:00