Cask Actors: Cask Actors: a tiny, lightweight, typed Scala Actor library

I’ve just published a new Actor library, Cask Actors:

This library aims at small-scale in-process use cases, where you want to model things using concurrent actors, but pulling in a huge framework like Akka might be an overkill. The linked docs go into more detail in how to use it. Any feedback is welcome!

1 Like

This seems interesting! I’m on the beginning stages of making a window manager for linux using dotty, and I might use this inside it.

Is interesting for me too. Question: can one do dynamic routing as, e.g., needed for REST (you post a resource and get a new path to access the resource9

Is interesting for me too. Question: can one do dynamic routing as, e.g., needed for REST (you post a resource and get a new path to access the resource9

Cask Actors does not come with any feature for routing; you can only send messages to actors via programmatic reference to the Actor[T]. You’ll have to deal with resolving REST URLs to individual actors, as well as de-serializing HTTP fields into structured case classes, yourself: perhaps using a dictionary of actors with a serialization library like uPickle, or a server routing library like cask.Routes

I asked the wrong question for the email subject. From Cask Actors i was seduced to look at the main page of Cask. So the question addressed the Http framework. Does Cask provide dynamic routing?

Yes, in two ways:

  • The strings you pass to the route decorators like @cask.get("...") are dynamic; you can construct them from local variables, class constructor parameters, environment variables, etc.

  • If you need ultimate flexibility, you can define a route that takes a subpath = True as documented here, take the request.remainingPathSegments and dispatch to your own custom logic in any way you’d like

The Cask Actors library has been moved to its own repo and artifact, https://github.com/lihaoyi/castor