~singpolyma/sgx-jmp

669d9f16d6679587df975c2475c96d2884620470 — Stephen Paul Weber 1 year, 11 days ago a5e520e
Helper to get a promise that resolves after N seconds
1 files changed, 7 insertions(+), 0 deletions(-)

M lib/em.rb
M lib/em.rb => lib/em.rb +7 -0
@@ 23,6 23,13 @@ module EM
			end
		}.resume
		promise
	end

	def self.promise_timer(timeout)
		promise = EMPromise.new
		EM.add_timer(timeout) do
			promise.fulfill(nil)
		end
		promise
	end
end