File: channel.rb

package info (click to toggle)
ruby-em-synchrony 1.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 484 kB
  • ctags: 241
  • sloc: ruby: 3,115; sh: 34; makefile: 5
file content (14 lines) | stat: -rw-r--r-- 130 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
require 'go'

EM.synchrony do
  c = Channel.new

  go {
    sleep(1)
    c << 'go go go sleep 1!'
  }

  puts c.pop

  EM.stop
end