Discussion of Lagom project development: https://github.com/lagom/.github/blob/master/CONTRIBUTING.md | Use lagom/lagom channel for general discussion. | Code of Conduct: https://www.lightbend.com/conduct | Forums: https://discuss.lagomframework.com | Commercial support from https://www.lightbend.com/
octonato on bp
octonato on 1.6.x
[#3027] Bump first-time-bucket … (compare)
octonato on master
enrich AskTimeoutException with… (compare)
octonato on bp
mergify[bot] on improve-logging-on-timeout-take2
mergify[bot] on bp
enrich AskTimeoutException with… formatting (cherry picked from… assert full message (cherry pi… (compare)
mergify[bot] on 1.6.x
enrich AskTimeoutException with… formatting assert full message and 1 more (compare)
MetricsService
by implementation is normal case.
MetricsService
may be removed some time in the future. It’s a service providing per-instance information so it’s weird to read that info via RPC (where you usually want to treat all instances/nodes equally). Instead, metrics should be pushed to an external aggregator to create some form of dashboard.
MetricsService
. Now we do the following. We subscribe to the stream of data from MetricsService
and push data to an external MetricRegistry
(+ graphite reporter).
validateDependencyWhitelist
worked locally, but yeah, I was considering that too.
Hi all! :) I've been wondering recently... when it comes to Scala DSL for Lagom, it feels much like the Java DSL. I can see that oftentimes the return type is a Unit
, with side-effects, we reference context in a few places, rather than simply provide a A => B
function here and there.
Namely, instead of something like a DSL in akka-ddd [source]:
def canceledOrClosed: Actions =
handleCommand {
case CloseReservation(reservationId) =>
ReservationClosed(reservationId)
case CancelReservation(reservationId) =>
ReservationCanceled(reservationId)
}
.handleEvent {
case ReservationCanceled(_) => Canceled
case ReservationClosed(_) => Closed
}
we end up writing:
case (AddPost(content), ctx, state) =>
ctx.thenPersist(PostAdded(entityId, content)) { evt =>
ctx.reply(AddPostDone(entityId))
}
or:
case (AddPost(content), ctx, state) =>
if (content.title == null || content.title.equals("")) {
ctx.invalidCommand("Title must be defined")
ctx.done
}
My questions is - is there any particular reason why Scala DSL for Lagom does not feel Scala-idiomatic and resembles patterns common for Java-like frameworks? (diverging from FP, side-effects etc.)
Wouldn't it be better if one might be able to say e.g.:
case AddPost(content) =>
PostAdded(entityId, content)
(...)
case PostAdded(entityId, _) =>
AddPostDone(entityId)
and:
case AddPost(Content(None, _)) | AddPost(Content(Some(""), _)) =>
InvalidCommand("Title must be defined")
What do you think?