Created
September 26, 2012 04:21
-
-
Save hoshinotsuyoshi/3786011 to your computer and use it in GitHub Desktop.
Schedulefile(openwfe/util/scheduler)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!ruby | |
# coding: utf-8 | |
require 'openwfe/util/scheduler' | |
include OpenWFE | |
#schedulerインスタンスを作成しスタートさせる | |
scheduler = Scheduler.new | |
scheduler.start | |
# Cronでの記述ができる | |
# 毎分に実行する例 | |
scheduler.schedule('1-60 * * * *') do | |
p "#{Process.pid}" | |
p "-------------" | |
p "#{Time.now.to_s}" | |
p "-------------" | |
end | |
# 実際にスタートさせる | |
scheduler.join |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment