1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
-*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
3
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
5
* Definitions required for Configuration Variables plugin
6
* Copyright (C) 2008 Sun Microsystems
7
* Copyright (C) 2008 Mark Atwood
8
9
* This program is free software; you can redistribute it and/or modify
9
10
* it under the terms of the GNU General Public License as published by
19
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
#ifndef DRIZZLED_PLUGIN_SCHEDULER_H
23
#define DRIZZLED_PLUGIN_SCHEDULER_H
25
#include "drizzled/session.h"
26
#include "drizzled/plugin/plugin.h"
40
* This class should be used by scheduler plugins to implement custom session
43
class Scheduler : public Plugin
45
/* Disable default constructors */
47
Scheduler(const Scheduler &);
48
Scheduler& operator=(const Scheduler &);
50
explicit Scheduler(std::string name_arg)
51
: Plugin(name_arg, "Scheduler")
53
virtual ~Scheduler() {}
56
* Add a session to the scheduler. When the scheduler is ready to run the
57
* session, it should call session->run().
59
virtual bool addSession(Session::shared_ptr &session)= 0;
62
* Notify the scheduler that it should be killed gracefully.
64
virtual void killSession(Session *) {}
67
* This is called when a scheduler should kill the session immedaitely.
69
virtual void killSessionNow(Session::shared_ptr&) {}
71
static bool addPlugin(plugin::Scheduler *sced);
72
static void removePlugin(plugin::Scheduler *sced);
73
static bool setPlugin(const std::string& name);
74
static Scheduler *getScheduler();
77
} /* namespace plugin */
78
} /* namespace drizzled */
80
#endif /* DRIZZLED_PLUGIN_SCHEDULER_H */
23
#ifndef DRIZZLED_PLUGIN_SCHEDULING_H
24
#define DRIZZLED_PLUGIN_SCHEDULING_H
26
typedef struct scheduling_st
29
bool (*init_new_connection_thread)(void);
30
bool (*add_connection)(Session *session);
31
void (*post_kill_notification)(Session *session);
32
bool (*end_thread)(Session *session, bool cache_thread);
35
#endif /* DRIZZLED_PLUGIN_SCHEDULING_H */