Skip to content

tell method in actor is not working with sleep #110

Closed
@windbird123

Description

@windbird123

The following code was not working as expected. (ox version: 0.0.24)

import ox.supervised
import ox.channels.*

class Stateful:
  private var counter: Int = 0

  def increment(delta: Int): Int =
    counter += delta
    Thread.sleep(100)
    println(counter)
    counter

supervised {
  val ref = Actor.create(new Stateful)
  ref.tell(_.increment(5))
}

expected results: prints 5
actual results: prints nothing

When Thread.sleep(100) line was removed, it worked as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions