/examples/thread_safety.fy
Unknown | 14 lines | 11 code | 3 blank | 0 comment | 0 complexity | 7a10396672a0616aad6e10a1071402b3 MD5 | raw file
Possible License(s): BSD-3-Clause
- 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