Sha256: f91426db123e32cf28d58f0a0f4f4b0bc14a765d0ee996987e8526a60c064869

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

pong = nil
done = false

ping = Actor spawn: {
  loop: {
    count = Actor receive
    "." print
    { count println; done = true; break } if: (count > 1000)
    pong ! (count + 1)
  }
}

pong = Actor spawn: {
  loop: {
    count = Actor receive
    "-" print
    { count println; done = true; break } if: (count > 1000)
    ping ! (count + 1)
  }
}

ping ! 1

# Let the actors process while the main thread sleeps...
until: { done } do: {
  Thread sleep: 0.1
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fancy-0.4.0 examples/actors_primitive.fy