We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ce865e commit 629b5ddCopy full SHA for 629b5dd
README.md
@@ -114,3 +114,26 @@ loop do
114
end
115
116
```
117
+
118
+## Concurrent Execution
119
120
+Concurrent execution is done by calling `#spin`, which creates a fiber:
121
122
+```ruby
123
+machine = UringMachine.new
124
125
+rfd, wfd = machine.pipe
126
127
+f1 = machine.spin do
128
+ machine.write(wfd, 'hello')
129
+ machine.write(wfd, 'world')
130
+ machine.close(wfd)
131
+end
132
133
+bgid = machine.setup_buffer_ring(4096, 1024)
134
+f2 = machine.spin do
135
+ machine.read_each(rfd, bgid) do |str|
136
+ puts str
137
+ end
138
139
+```
0 commit comments