Skip to content

Instantly share code, notes, and snippets.

@hoshinotsuyoshi
Created September 26, 2012 04:21
Show Gist options
  • Save hoshinotsuyoshi/3786011 to your computer and use it in GitHub Desktop.
Save hoshinotsuyoshi/3786011 to your computer and use it in GitHub Desktop.
Schedulefile(openwfe/util/scheduler)
#!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