mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
734 B
34 lines
734 B
15 years ago
|
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
|
||
15 years ago
|
#ifndef NODE_SIGNAL_WATCHER_H_
|
||
|
#define NODE_SIGNAL_WATCHER_H_
|
||
15 years ago
|
|
||
|
#include <node.h>
|
||
15 years ago
|
#include <node_events.h>
|
||
15 years ago
|
|
||
|
#include <v8.h>
|
||
|
#include <ev.h>
|
||
|
|
||
|
namespace node {
|
||
|
|
||
15 years ago
|
class SignalWatcher : EventEmitter {
|
||
15 years ago
|
public:
|
||
|
static void Initialize(v8::Handle<v8::Object> target);
|
||
|
|
||
|
protected:
|
||
|
static v8::Persistent<v8::FunctionTemplate> constructor_template;
|
||
|
|
||
15 years ago
|
SignalWatcher() : EventEmitter() { }
|
||
|
~SignalWatcher();
|
||
15 years ago
|
|
||
|
static v8::Handle<v8::Value> New(const v8::Arguments& args);
|
||
|
static v8::Handle<v8::Value> Stop(const v8::Arguments& args);
|
||
|
|
||
|
private:
|
||
|
static void OnSignal(EV_P_ ev_signal *watcher, int revents);
|
||
|
ev_signal watcher_;
|
||
|
};
|
||
|
|
||
|
} // namespace node
|
||
15 years ago
|
#endif // NODE_SIGNAL_WATCHER_H_
|
||
15 years ago
|
|