Hi All,
In my project I'm trying to upgrade cask from 0.6.7 to 0.7.5
The main entry point for my app looks something like this:
object Launcher extends cask.Main {
override def allRoutes: Seq[Routes] = Seq(MyCustomRoute())
}
MyCustomRoute (which implements cask.main.Routes) is relatively complex, has several endpoints, static files, static resources, websockets. But it does work with cask 0.6.7.
But as I am trying to upgrade to 0.7.5, as I launch my application I get the below error:
Receiver class MyCustomRoute does not define or inherit an implementation of the resolved method 'abstract void cask$main$Routes$setter$actorContext_$eq(castor.Context$Simple)' of interface cask.main.Routes.
Any idea how to track down where the error could be?
id
case class
es if you want to inject things into them
./mill -w app.runBackground
Compiling /private/tmp/minimalApplication-0.7.6/build.sc
build.sc:4: object creation impossible. Missing implementation for:
def crossScalaVersion: String // inherited from trait CrossModuleBase
object app extends CrossScalaModule{
^
Compilation Failed
CrossScalaModule
back into a normal ScalaModule
def crossScalaVersion
field, but I think for an example project the non-cross module is simpler and more newbie friendly)
Hello,
I've been trying out cask
and so far loving the simplicity!
However, I have a question regarding how to shut down cask
application correctly. Scenario is this: in the main object (extends cask.Main
) message consumer is created, this consumer runs in the main's thread. It basically polls a queue (java.util.concurrent.BlockingQueue
) and does some work. Now in the router object (extends cask.Routes
) on every request its body is put into this queue. So for example if queue consumer fails and throws an exception, I'd like for the whole application to stop. Not sure if it's a good approach but I've tried executionContext.shutdown
from within object extending cask.Main
but routes are still being served and JVM does not exit. So what's the correct way here?
Undertow
server. So I guess I'll just override cask.Main.main
and create the server directly. Though it would be nice for DefaultHandler
to be exposed publicly without needing to extend cask.Main
because now I only need defaultHandler
from it :).