Skip to content

DougEverly/DelayedThread

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

DelayedThread

DelayedThread constructs threads with delayed execution.

Usage

d = DelayedThread.new

# Add a delayed thread

d.delayed_thread do
  5.times do |x|
    puts x.to_s
    sleep 1
  end
end

# Add another delayed thread

d.delayed_thread do
  5.times do |x|
    puts (x * 2).to_s
    sleep 1
  end
end

# wait some time

sleep 2

# start delayed thread execution

d.start

# join delayed threads

d.join

Do not delay threads

d.delayed = false

Get list of delayed threads

d.threads # => Array

About

DelayedThread constructs threads with delayed execution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages