Sha256: c10f806cacd72dda07f2b23c93ebd4cf45c68db0c646a628308d193f2aea756b

Contents?: true

Size: 1.95 KB

Versions: 17

Compression:

Stored size: 1.95 KB

Contents

/*
 *  Phusion Passenger - https://www.phusionpassenger.com/
 *  Copyright (c) 2011, 2012 Phusion
 *
 *  "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
 *
 *  Permission is hereby granted, free of charge, to any person obtaining a copy
 *  of this software and associated documentation files (the "Software"), to deal
 *  in the Software without restriction, including without limitation the rights
 *  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 *  copies of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be included in
 *  all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 *  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 *  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 *  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 *  THE SOFTWARE.
 */
#ifndef _BACKGROUND_EVENT_LOOP_H_
#define _BACKGROUND_EVENT_LOOP_H_

#include <boost/shared_ptr.hpp>
#include <string>

extern "C" {
	struct ev_loop;
	struct ev_async;
}

namespace Passenger {
	using namespace std;
	using namespace boost;

	class SafeLibev;
	struct BackgroundEventLoopPrivate;

	/**
	 * Implements a libev event loop that runs in a background thread.
	 */
	struct BackgroundEventLoop {
		struct ev_loop *loop;
		ev_async *async;
		shared_ptr<SafeLibev> safe;
		BackgroundEventLoopPrivate *priv;
		
		BackgroundEventLoop(bool scalable = false);
		~BackgroundEventLoop();
		
		void start(const string &threadName = "", unsigned int stackSize = 1024 * 1024);
		void stop();
	};

}

#endif /* _BACKGROUND_EVENT_LOOP_H_ */

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
passenger-4.0.18 ext/common/BackgroundEventLoop.h
passenger-4.0.17 ext/common/BackgroundEventLoop.h
passenger-4.0.16 ext/common/BackgroundEventLoop.h
passenger-4.0.14 ext/common/BackgroundEventLoop.h
passenger-4.0.13 ext/common/BackgroundEventLoop.h
passenger-4.0.10 ext/common/BackgroundEventLoop.h
passenger-4.0.8 ext/common/BackgroundEventLoop.h
passenger-4.0.7 ext/common/BackgroundEventLoop.h
passenger-4.0.6 ext/common/BackgroundEventLoop.h
passenger-4.0.5 ext/common/BackgroundEventLoop.h
passenger-4.0.4 ext/common/BackgroundEventLoop.h
passenger-4.0.3 ext/common/BackgroundEventLoop.h
passenger-4.0.2 ext/common/BackgroundEventLoop.h
passenger-4.0.1 ext/common/BackgroundEventLoop.h
passenger-4.0.0.rc6 ext/common/BackgroundEventLoop.h
passenger-4.0.0.rc4 ext/common/BackgroundEventLoop.h
passenger-3.9.2.beta ext/common/BackgroundEventLoop.h