As configured in my dotfiles.
start new:
tmux
start new with session name:
package com.mojolly.websocket | |
import org.scalatra._ | |
import javax.servlet.http.{HttpServletResponse, HttpServletRequest} | |
import org.eclipse.jetty.websocket.{WebSocket => ServletWebSocket, WebSocketFactory} | |
import akka.util.Logging | |
import java.io.UnsupportedEncodingException | |
import org.eclipse.jetty.websocket.WebSocket.Outbound | |
import collection.mutable.{ HashSet, SynchronizedSet } |
public class AsyncTest extends Controller | |
{ | |
public static void gotchas() | |
{ | |
params.put("foo", "bar"); // Check if changes to params survive the request being suspended | |
renderArgs.put("foo", "bar"); // Check if changes to renderArgs survive the request being suspended | |
final String foo = "bar"; // Must be declared final to use in the callback | |
F.Promise<WS.HttpResponse> remoteCall1 = WS.url("http://www.remote-service.com/data/1").getAsync(); | |
F.Promise<WS.HttpResponse> remoteCall2 = WS.url("http://www.remote-service.com/data/2").getAsync(); |
organization := "net.seratch" | |
name := "sandbox" | |
version := "0.1" | |
scalaVersion := "2.9.1" | |
libraryDependencies ++= Seq( | |
"junit" % "junit" % "4.9" withSources(), |
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.libs.ws._ | |
import play.api.libs.iteratee._ | |
import play.api.libs.concurrent._ | |
object Application extends Controller { | |
Essential blueprint of Play2 architecture is pretty simple and it should be easy to explain in a fairly short blog post. The framework can be understood progressively at different levels; each time having better exposure to some aspects of its design.
The core of Play2 is really small, surrounded by a fair amount of useful APIs, services and structure to make Web Programming tasks easier.
Basically, Play2 is an API that abstractly have the folllowing type
One of the goals of Play2 architecture is to provide a programming model for what is called Realtime Web Applications.
Realtime Web Applications are applications that make use of Websockets, Server Sent Events, Comet or other protocols offering/simulating an open socket between the browser and the server for continuous communication. Basically, these applications let users work with information as it is published - without having to periodically ping the service.
There are quite a few web frameworks that target the development of this type of application: but usually the solution is to simply provide an API that allows developers to push/receive messages from/to an open channel, something like:
#Ebauche d'un framework MVC (Client) en Dart
##Installation
##Créer un 1er projet
Nommer le projet "cubitus", modifier cubitus.html