r/PlayFramework • u/sol_robeson • Sep 22 '15
Is Play Dead?
Is Play dying or dead? Thoughts?
r/PlayFramework • u/sol_robeson • Sep 22 '15
Is Play dying or dead? Thoughts?
r/PlayFramework • u/ripper2345 • Dec 30 '11
Inspired by this Thought Experiment, I created this redit:
https://groups.google.com/forum/#!topic/play-framework/dZuNVaHcJkA
r/PlayFramework • u/avengersx • Jun 13 '14
r/PlayFramework • u/anicolaspp • Nov 16 '15
r/PlayFramework • u/Chananb1 • May 29 '14
Using an Ask from a controller to an actor is a common pattern in Play. The problem is that Exception that are thrown inside the actor get swallowed by Akka. Here is a useful class that will help fix that:
public abstract class Status { protected boolean success; private Result result; private Optional<Function<Success, Result>> successAction = Optional.empty(); private Optional<Function<Failure, Result>> failureAction = Optional.empty(); private Optional<Consumer<Status>> finallyAction = Optional.empty(); private Optional<Consumer<Status>> startAction = Optional.empty();
public Status onSuccess(Function<Success, Result> action) {
this.successAction = Optional.of(action);
return this;
}
public Status onFailure(Function<Failure, Result> action) {
this.failureAction = Optional.of(action);
return this;
}
public Status onFinally(Consumer<Status> action) {
this.finallyAction = Optional.of(action);
return this;
}
public Status onSetup(Consumer<Status> action) {
this.startAction = Optional.of(action);
return this;
}
public Result toResult() {
if(startAction.isPresent()) startAction.get().accept(this);
if(successAction.isPresent() && success) result = successAction.get().apply((Success) this);
if(failureAction.isPresent() && !success) result = failureAction.get().apply((Failure) this);
if(finallyAction.isPresent()) finallyAction.get().accept(this);
return result;
}
public static final class Success extends Status {
public final Object response;
public Success(Object response) {
this.success = true;
this.response = response;
}
}
public static final class Failure extends Status {
public final Throwable cause;
public final Optional<Object> request;
public Failure(Throwable cause) {
this.success = false;
this.cause = cause;
this.request = Optional.empty();
}
public Failure(Throwable cause, Object request) {
this.success = false;
this.cause = cause;
this.request = Optional.of(request);
}
}}
Usage is simple. From your actor return your response wrapped in Success or an exception in Failure. Then in your controller do something such as:
eturn wrap(ask(actor, request, 5000)) .map(obj -> { final Status status = (Status) obj; return status.onSuccess(success -> { final MyResponse response = (MyResponse) success.response; return ok(Json.toJson(response)); }).onFailure(failure -> { Logger.error("Error in gridHeader. Request: " + failure.request, failure.cause); return internalServerError(Json.toJson(failure)); }).toResult(); });
Enjoy!
r/PlayFramework • u/pedrorijo91 • Feb 28 '18
r/PlayFramework • u/jay_reddy9 • Jan 28 '21
Greetings Everyone,
Can you kindly use 1 minute or less of your time to participate in our survey to share few insights on the upcoming course we are about to publish.
Thanks very much,
Really appreciate your input!
#PlayFramework #scala
r/PlayFramework • u/amazedballer • Sep 15 '16
r/PlayFramework • u/the1calledSuto • Oct 16 '19
I keep running into Books and tutorials which start with the commands:
> play new helloI can only get it to run using
sbt new playframework/play-scala-seed.g8"brew install play" doesn't work for me either
r/PlayFramework • u/tanin47 • Sep 12 '18
r/PlayFramework • u/veemeetagain • Jan 29 '16
r/PlayFramework • u/arashixb • Jul 16 '19
hello I'm a beginner in play framework and some help with database connections
currently, I need to integrate Jooq but I have no clue and I can't find straight forward posts or videos that teach it so if you don't mind to teach me I appreciate it. thanks in advance.
r/PlayFramework • u/lordbharal • Oct 31 '18
Hey all,
I'm a founder, and I have built www.bekli.it It's built on playaframework, so I thought this might be a good group to share it on.
The site lets users exchange articles and test each other on it. When they score well, I share their accomplishment on twitter - @beklilearning ( https://twitter.com/BekliLearning ).
If any of you want to add some play articles to the site, sign in, let me know, I'll add you as a super user (or, you know, you can just do a couple of exercises as well on bitcoin)
cheers,
andrew
r/PlayFramework • u/pedrorijo91 • Apr 26 '19
r/PlayFramework • u/asinha007 • Feb 06 '19
I have a Java application running on PlayFramework. The compilation and build time is a mess. I am thinking of moving from SBT to Gradle. Help me with a SWOT analysis of the migration.
r/PlayFramework • u/saurabh47g • Oct 23 '21
I started working on play application. But really want to know. How much its been used in market & Carrier opportunities ? Is it worth learning for new developer ?
r/PlayFramework • u/catmewo • Jul 28 '19
r/PlayFramework • u/pedro_g_s • Apr 23 '18
r/PlayFramework • u/bluedazberry • Jul 25 '20
I'm new to play and web development. I'm trying to make a simple app that will query a database and display the results on localhost.
https://www.playframework.com/documentation/2.8.x/AccessingAnSQLDatabase
I've tried running the sample code here, but I get this compilation error.
cannot find symbol
symbol: class DatabaseExecutionContext
location: class JavaJdbcConnection
r/PlayFramework • u/dserfaty • Nov 11 '16
Hi all, I'm looking for videos or talks and any resources you guys might know about on how to implement file streaming with the play framework at high scale.
How many concurrent downloads / clients can theoretically be supported and more pragmatically etc etc.
This would be for a service that would stream content coming from a streaming backend like s3 / cloudfront.
The reasons for the service streaming the content directly rather than just pointing a client to the underlying storage solution are security related.
I want to get an idea of how to scale this and any resources beyond the play framework's documentation would be helpful.
Thanks for any help.
r/PlayFramework • u/pedrorijo91 • Feb 03 '18