I have Scala Play application and I am invoking the Scala Akka Scheduler in the class like this:
@Singleton
class Foo @Inject() (
actorSystem: ActorSystem,
)(implicit
executionContext: ExecutionContext,
) extends Logging {
actorSystem.scheduler.schedule(delay, interval)(poller())
def poller(): Unit ...
}
But I get a compiler warning like this
discarded non-Unit value
[error] actorSystem.scheduler.schedule(delay, interval)(poller())
Is there a way to suppress this or code this in some way to eliminate the compiler error?