enragedginger / akka-quartz-scheduler

Quartz Extension and utilities for cron-style scheduling in Akka
Other
559 stars 114 forks source link

Support for Akka Typed #101

Closed froth closed 3 years ago

froth commented 4 years ago

As the typed akka api is now the default in the akka project it would be nice if akka-quartz-scheduler would support it.

For example all api's that currently have the current format:

def schedule(name: String, receiver: ActorRef, msg: AnyRef)

should have an additional typed implemention of the form

def schedule[T](name: String, receiver: ActorRef[T], msg: T)

However it would require a typed implementation of SimpleActorMessageJob I think. My first thought for the content of the jobDataMap would be:

case class ReceiverWithMessage[T](receiver: ActorRef[T], msg: T)
val jobDataMap = Map[String, AnyRef](
      "logBus" -> system.eventStream,
      "receiverWithMessage" -> ReceiverWithMessage(receiver, msg)
    )

However I am currently not sure what to do with MessageRequireFireTime.

ngu04 commented 4 years ago

I have updated actor from 2.5.x to 2.6.x and now quartz actor doesn't have support for typed-actor so I wouldn't be able to use quartz or typed actor :-(

felipebonezi commented 4 years ago

@froth @ngu04 I've opened a Pull Request, check it out!

felipebonezi commented 3 years ago

Hey guys, I'm already using in production. So, if you want to use before @enragedginger review PR #102


private val akkaQuartzVersion = "1.9.0-akka-2.6.x"
libraryDependencies += "com.enragedginger" %% "akka-quartz-scheduler" % akkaQuartzVersion
resolvers += "Bintray".at("https://dl.bintray.com/justa/maven/")```
enragedginger commented 3 years ago

The new release has been cut for this and is available on maven central.

felipebonezi commented 3 years ago

@enragedginger why Travis is build not passing?

enragedginger commented 3 years ago

The QuartzSchedulerFunctionalSpec tests are flaky and have been that way for awhile now. If I run the whole test suite with sbt test two of the tests in that class fail. But just running the QuartzSchedulerFunctionalSpec tests alone results in success. If you could find a way to make them succeed 100% of the time, that'd be great.

felipebonezi commented 3 years ago

The QuartzSchedulerFunctionalSpec tests are flaky and have been that way for awhile now. If I run the whole test suite with sbt test two of the tests in that class fail. But just running the QuartzSchedulerFunctionalSpec tests alone results in success. If you could find a way to make them succeed 100% of the time, that'd be great.

@enragedginger figure out that if we run the test method by your self (only the method) it works. I think we have some concurrency problem in the test with Typed Actors. Can you help me to how to fix it?

felipebonezi commented 3 years ago

@enragedginger it was my mistake! Figure out that I´ve other test has a bug that occours in some cenarios...

ALL FIXED AT PR #103