Slide 1

Slide 1 text

竝⾏ Pararell

Slide 2

Slide 2 text

.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)

Slide 3

Slide 3 text

https://hex.pm/packages/holiday_jp https://hex.pm/packages/pqueue2 https://hex.pm/packages/stream_gzip https://hex.pm/packages/stream_hash

Slide 4

Slide 4 text

竝⾏ Pararell

Slide 5

Slide 5 text

Node.js is concurrent. Crystal is concurrent. Concurrent

Slide 6

Slide 6 text

Node.js is concurrent. Crystal is concurrent. Also Ruby is concurrent. Concurrent

Slide 7

Slide 7 text

Thread thread1 = Thread.new { } thread2 = Thread.new { } [thread1, thread2].each &:join Concurrent

Slide 8

Slide 8 text

Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby future = Concurrent::Future.execute { } while future.pending? sleep 0.1 end future.value Concurrent

Slide 9

Slide 9 text

Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby Concurrent::Promise.execute { }.then { } Concurrent

Slide 10

Slide 10 text

Concurrent Ruby https://github.com/ruby-concurrency/concurrent-ruby class Echo include Concurrent::Async def echo(msg) print "#{msg}\n” end End horn = Echo.new horn.async.echo 'oneʼ horn.await.echo 'two' Concurrent

Slide 11

Slide 11 text

EventMachine https://github.com/eventmachine/eventmachine/ EM::run do client = MyApp.new give_tick = proc do Gtk::main_iteration_do false EM.next_tick give_tick end give_tick.call end Concurrent

Slide 12

Slide 12 text

nio4r https://github.com/socketry/nio4r selector = NIO::Selector.new loop do selector.select do |monitor| end end Concurrent

Slide 13

Slide 13 text

Crystal https://crystal-lang.org/ ch = Channel(Int).new spawn do ch.send 42 end value = ch.receive Concurrent

Slide 14

Slide 14 text

Concurrent ? Pararell ?

Slide 15

Slide 15 text

Concurrent 竝列 Concurrent Task Task Task

Slide 16

Slide 16 text

Pararell 竝⾏ Pararell Task Task Task

Slide 17

Slide 17 text

Go is pararell. Pararell

Slide 18

Slide 18 text

Go https://golang.org/ ch := make(chan string) go f(“some”, ch) <- ch Pararell

Slide 19

Slide 19 text

Go is pararell. Pararell

Slide 20

Slide 20 text

Go is pararell. Ruby is _ Pararell

Slide 21

Slide 21 text

pararell https://github.com/grosser/parallel Pararell.map([]) { } Pararell.each([]) { } Pararell.any?([]) { } Pararell.all?([]) { } Pararell

Slide 22

Slide 22 text

pararell Inside pararell: Pararell

Slide 23

Slide 23 text

pararell Inside pararell: Process.fork { } Pararell

Slide 24

Slide 24 text

pararell Inside pararell: Process.fork { } Pararell

Slide 25

Slide 25 text

Use Elixir Pararell

Slide 26

Slide 26 text

Use Elixir Pararell Pararell

Slide 27

Slide 27 text

Use Elixir Pararell Fault tolerant Pararell

Slide 28

Slide 28 text

Use Elixir Pararell Fault tolerant Soft realtime Pararell