/examples/thread_safety.fy
http://github.com/bakkdoor/redis.fy · Unknown · 14 lines · 11 code · 3 blank · 0 comment · 0 complexity · 7a10396672a0616aad6e10a1071402b3 MD5 · raw file
- require: "redis"
- r = Redis Client new
- threads = []
- 10 times: |i| {
- t = Thread new: {
- r set: ("foo", "test: #{i}")
- r get: "foo" . println
- }
- threads << t
- }
- threads each: 'join