Giter Club home page Giter Club logo

swarm's Introduction

Swarm

What is it?

Swarm is a framework allowing the creation of applications which can scale transparently through a novel portable continuation-based approach. Like Map-Reduce, Swarm follows the maxim "move the computation, not the data". However Swarm takes the concept much further, allowing it to be applied to almost any computation, not just those that can be broken down into map and reduce operations.

In effect, Swarm will be the ultimate "Platform as a Service", going much further than systems like Google App Engine in relieving the programmer from the difficulties of cloud computing.

Community

IRC: irc.freenode.net #swarmproject

Mailing List

Quick Start Guide

Note: Swarm is still very-much a work in progress. These instructions will let you play with some proof-of-concept demos, but Swarm remains a long way from being of practical use.

These instructions assume you are using a Linux or Mac-like system. If you are using Windows, we recommending using Cygwin which should allow you to follow these instructions more-or-less verbatim.

Install Scala 2.10.x

Installation Instructions

Download Swarm

git clone [email protected]:sanity/Swarm.git

Run the demo

From the Swarm directory, in one console window:

$ sbt/sbt "demos/run-main org.swarmframework.demos.Listen"

Then, in another console window:

$ sbt/sbt "demos/run-main org.swarmframework.demos.ExplicitMoveTo1"

In this demo keep an eye on both consoles, you will be asked for input in one console, then the other. The surprising thing is that the code jumps between consoles with a single command!

    val name = readLine("What is your name? ")
    moveTo(InetLocation(InetAddress.getLocalHost, 9997))
    val age = Integer.parseInt(readLine(s"Hello $name, what age are you? "))
    moveTo(InetLocation(InetAddress.getLocalHost, 9998))
    println(s"Wow $name you're half way to ${age * 2} years old!")

Run the Twitter simulator

From the command line, launch the Twitter demo:

$ sbt/sbt "demos/run-main org.swarmframework.demos.SwarmTwitter"

In a Web browser, navigate to http://localhost:8080/ and http://localhost:8081/ to interact with each node.

Developing Swarm with IntelliJ IDEA

If you haven't already, install the Scala and SBT plugins (we recommend the nightly versions, see the green box on the linked pages for auto-update).

Generate an IDEA project file:

$ sbt/sbt gen-idea

Now open the project in IDEA.

swarm's People

Contributors

bitwalker avatar earldouglas avatar pdoubleya avatar sanity avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swarm's Issues

Server blocked after RefMap propagation

One of my recent commits caused a problem which leads to a server being completely blocked from handling requests as soon as its peer tries to propagate an updated RefMap.

I suspect it was this commit:
c064dd8

Check the SwarmTwitterTemplate.statuses method for malfeasance

Exception when I click on a sample user in Twitter demo

Another snag...

java.lang.NoClassDefFoundError: swarm/twitter/SwarmBridge$
at swarm.twitter.SwarmTwitterTemplate$$anonfun$3.apply(SwarmTwitterTemplate.scala:73)
at org.scalatra.ScalatraKernel$Route$$anonfun$org$scalatra$ScalatraKernel$Route$$invokeAction$1.apply(ScalatraKernel.scala:78)
at org.scalatra.ScalatraKernel$Route$$anonfun$org$scalatra$ScalatraKernel$Route$$invokeAction$1.apply(ScalatraKernel.scala:77)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
at org.scalatra.ScalatraKernel$Route.org$scalatra$ScalatraKernel$Route$$invokeAction(ScalatraKernel.scala:76)
at org.scalatra.ScalatraKernel$Route$$anonfun$apply$1.apply(ScalatraKernel.scala:73)
at org.scalatra.ScalatraKernel$Route$$anonfun$apply$1.apply(ScalatraKernel.scala:73)
at scala.Option.flatMap(Option.scala:147)
at org.scalatra.ScalatraKernel$Route.apply(ScalatraKernel.scala:73)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2$$anonfun$7.apply(ScalatraKernel.scala:137)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2$$anonfun$7.apply(ScalatraKernel.scala:137)
at scala.collection.immutable.Stream.flatMap(Stream.scala:209)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply$mcV$sp(ScalatraKernel.scala:137)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1$$anonfun$apply$mcV$sp$2.apply(ScalatraKernel.scala:134)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply$mcV$sp(ScalatraKernel.scala:134)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:134)
at org.scalatra.ScalatraKernel$$anonfun$handle$1$$anonfun$apply$mcV$sp$1.apply(ScalatraKernel.scala:134)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply$mcV$sp(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:133)
at org.scalatra.ScalatraKernel$$anonfun$handle$1.apply(ScalatraKernel.scala:133)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
at org.scalatra.ScalatraKernel$class.handle(ScalatraKernel.scala:132)
at org.scalatra.ScalatraServlet.handle(ScalatraServlet.scala:11)
at org.scalatra.ScalatraServlet.service(ScalatraServlet.scala:18)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Create a "forked JVM" test framework

The current unit tests rely on the InMemTest class, which is a bit of a hack to simulate continuation serialization transport.

It would be much better to create a test framework which can be run as a usual unit test (i.e. with sbt test) that kicks off two real InetTransporter.listen threads (on different local ports) and tests actual serialization and transportation over sockets.

This might be doable with some advanced sbt trickery, or within a class via some clever class loading.

Exception while running swarm.demos.Listen

@JamesEarlDouglas @bitwalker Would one of you guys mind taking a look at this, I'm not very familiar with SBT

[info] Resolving org.scalatra#scalatra_2.9.2;2.0.1 ...
[warn]  module not found: org.scalatra#scalatra_2.9.2;2.0.1
[warn] ==== local: tried
[warn]   /Users/ian/.ivy2/local/org.scalatra/scalatra_2.9.2/2.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scalatra/scalatra_2.9.2/2.0.1/scalatra_2.9.2-2.0.1.pom
[info] Resolving org.scalatra#scalatra-auth_2.9.2;2.0.1 ...
[warn]  module not found: org.scalatra#scalatra-auth_2.9.2;2.0.1
[warn] ==== local: tried
[warn]   /Users/ian/.ivy2/local/org.scalatra/scalatra-auth_2.9.2/2.0.1/ivys/ivy.xml
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/scalatra/scalatra-auth_2.9.2/2.0.1/scalatra-auth_2.9.2-2.0.1.pom
[info] Resolving org.scala-lang#scala-compiler;2.9.2 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.scalatra#scalatra_2.9.2;2.0.1: not found
[warn]  :: org.scalatra#scalatra-auth_2.9.2;2.0.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.scalatra#scalatra_2.9.2;2.0.1: not found
unresolved dependency: org.scalatra#scalatra-auth_2.9.2;2.0.1: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:117)
    at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:117)
    at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:105)
    at sbt.IvySbt.liftedTree1$1(Ivy.scala:52)
    at sbt.IvySbt.action$1(Ivy.scala:52)
    at sbt.IvySbt$$anon$3.call(Ivy.scala:61)
    at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
    at xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:81)
    at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
    at xsbt.boot.Using$.withResource(Using.scala:11)
    at xsbt.boot.Using$.apply(Using.scala:10)
    at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
    at xsbt.boot.Locks$GlobalLock.liftedTree1$1(Locks.scala:52)
    at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
    at xsbt.boot.Locks$.apply0(Locks.scala:31)
    at xsbt.boot.Locks$.apply(Locks.scala:28)
    at sbt.IvySbt.withDefaultLogger(Ivy.scala:61)
    at sbt.IvySbt.withIvy(Ivy.scala:102)
    at sbt.IvySbt.withIvy(Ivy.scala:98)
    at sbt.IvySbt$Module.withModule(Ivy.scala:117)
    at sbt.IvyActions$.update(IvyActions.scala:121)
    at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:955)
    at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:953)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$58.apply(Defaults.scala:976)
    at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$58.apply(Defaults.scala:974)
    at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:978)
    at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:973)
    at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
    at sbt.Classpaths$.cachedUpdate(Defaults.scala:981)
    at sbt.Classpaths$$anonfun$47.apply(Defaults.scala:858)
    at sbt.Classpaths$$anonfun$47.apply(Defaults.scala:855)
    at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
    at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
    at sbt.std.Transform$$anon$5.work(System.scala:71)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:238)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
[error] (demos/*:update) sbt.ResolveException: unresolved dependency: org.scalatra#scalatra_2.9.2;2.0.1: not found
[error] unresolved dependency: org.scalatra#scalatra-auth_2.9.2;2.0.1: not found
[error] Total time: 6 s, completed Aug 17, 2013 1:42:55 PM

Compilation failure with Swarm client

Not quite sure what is wrong here - its claiming that its building against Scala 2.9.0 which I assume includes the continuations stuff. Sorry, I'm not very familiar with sbt so not really able to debug it myself :-(

[info] Recompiling project definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Building project swarm 1.0-SNAPSHOT against Scala 2.9.0
[info] using SwarmProject with sbt 0.7.7 and Scala 2.7.7

project swarm-twitter-node1
Set current project to swarm-twitter-node1 1.0-SNAPSHOT
jetty-run
[info]
[info] == swarm-core / compile ==
[info] Source analysis: 8 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] bad option: -P:continuations:enable
[error] one error found
[info] == swarm-core / compile ==
[info]
[info] == swarm-core / copy-resources ==
[info] == swarm-core / copy-resources ==
[info]
[info] == swarm-twitter-core / copy-resources ==
[info] == swarm-twitter-core / copy-resources ==
[info]
[info] == swarm-twitter-node1 / copy-resources ==
[info] == swarm-twitter-node1 / copy-resources ==
[error] Error running compile: Compilation failed
[info]
[info] Total time: 4 s, completed May 22, 2011 9:14:25 AM

Hot Code Loading (Remote Class Loading)

Swarm requires that every Swarm node be running the same codebase.

I think this can be achieved by hooking into the JVM's classloader and making it retrieve packages on-demand as they are needed. This concept is inspired by the Zero Install package management system.

This would probably involve having some kind of public crypto key in the package name as a unique identifier - eg: package swarm.bR781Z1h7.wombat.3.0

Data repositories are not thread-safe

The Store class and its Repository implementation are thread-unsafe, which will result in trouble when multiple clients use Swarm simultaneously. A thread-safe approach to managing per-node repositories as well as inter-node updates and relocations is needed. Consider using STM as a model pattern.

Concurrency

(Just porting over Google Code issues)

Ian proposed examining "software transactional memory" as a way to prevent threads from interfering with each-other in bad ways. This spawned a discussion on the pros and cons of various approaches. Read the thread here.

Demo in readme failing with ClassNotFoundException

Paul, would you mind looking into this as I'm not very familiar with sbt, and I'm still refreshing my memory about Scala (I've been in Kotlin-land for the last year ;).

Here is the output from sbt when I attempt to launch swarm.demos.Listen, I'm following the instructions in the main readme verbatim:

ian@vega-4 /t/Swarm:master> sbt/sbt "demos/run-main swarm.demos.Listen"                                                        13-08-18 11:38:23
[info] Loading project definition from /private/tmp/Swarm/project
[info] Updating {file:/private/tmp/Swarm/project/}default-3203b0...
[info] Resolving org.scala-sbt#precompiled-2_10_1;0.12.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to /private/tmp/Swarm/project/target/scala-2.9.2/sbt-0.12/classes...
[info] Set current project to core (in build file:/private/tmp/Swarm/)
[info] Updating {file:/private/tmp/Swarm/}core...
[info] Resolving org.scala-lang#scala-reflect;2.10.1 ...
[info] Done updating.
[info] Updating {file:/private/tmp/Swarm/}demos...
[info] Resolving org.scala-lang#scala-reflect;2.10.1 ...
[info] Done updating.
[info] Compiling 10 Scala sources to /private/tmp/Swarm/swarm-core/target/scala-2.10/classes...
[warn] /private/tmp/Swarm/swarm-core/src/main/scala/swarm/Swarm.scala:149: expression matchEnd5(x: Unit){
[warn]   x
[warn] } is cps-transformed unexpectedly
[warn]     xs match {
[warn]     ^
[warn] /private/tmp/Swarm/swarm-core/src/main/scala/swarm/Swarm.scala:152: a pure expression does nothing in statement position; you may be omitting necessary parentheses
[warn]         f(x)
[warn]          ^
[warn] there were 7 feature warning(s); re-run with -feature for details
[warn] three warnings found
[info] Compiling 5 Scala sources to /private/tmp/Swarm/swarm-demos/target/scala-2.10/classes...
[info] Running swarm.demos.Listen
[error] (run-main) java.lang.ClassNotFoundException: swarm.demos.Listen
java.lang.ClassNotFoundException: swarm.demos.Listen
    at java.net.URLClassLoader$1.run(URLClassLoader.java:359)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:261)
[trace] Stack trace suppressed: run last demos/compile:run-main for the full output.
java.lang.RuntimeException: Nonzero exit code: 1
    at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last demos/compile:run-main for the full output.
[error] (demos/compile:run-main) Nonzero exit code: 1
[error] Total time: 16 s, completed Aug 18, 2013 11:38:54 AM

Create "Swarm-ful" collections like Set, List, and Map

Scala collections do not use Swarm references internally, which means that they cannot be split across multiple machines.

We need to create "Swarm-ful" versions of these collections that do use Swarm Refs internally.

sbt compilation failure

James, would you mind taking a look at this - I'm not really familiar with sbt, but it looks like its not accepting the command line parameter that enables continuations:

Swarm master $ sbt compile
Getting Scala 2.7.7 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (9911kB/619ms)
Getting org.scala-tools.sbt sbt_2.7.7 0.7.4 ...
:: retrieving :: org.scala-tools.sbt#boot-app
confs: [default]
15 artifacts copied, 0 already retrieved (4096kB/134ms)
[info] Recompiling project definition...
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
Getting Scala 2.8.1 ...
:: retrieving :: org.scala-tools.sbt#boot-scala
confs: [default]
2 artifacts copied, 0 already retrieved (15118kB/805ms)
[info] Building project swarm 1.0-SNAPSHOT against Scala 2.8.1
[info] using SwarmProject with sbt 0.7.4 and Scala 2.7.7
[info]
[info] == compile ==
[info] Source analysis: 10 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[info] 'compiler-interface' not yet compiled for Scala 2.8.1.final. Compiling...
[info] Compilation completed in 19.026 s
[error] bad option: -P:continuations:enable
[error] one error found
[info] == compile ==
[error] Error running compile: Compilation failed
[info]
[info] Total time: 21 s, completed Apr 24, 2011 12:49:44 PM
[info]
[info] Total session time: 27 s, completed Apr 24, 2011 12:49:44 PM
[error] Error during build.

Twitter demo throwing exception when visited in web browser

I follow the instructions in the readme, but when I visit http://localhost:8080/ I get the following error:

HTTP ERROR 500

Problem accessing /. Reason:

    javax.servlet.http.HttpServletResponse.getStatus()I
Caused by:

java.lang.NoSuchMethodError: javax.servlet.http.HttpServletResponse.getStatus()I
    at org.scalatra.servlet.RichResponse.status(RichResponse.scala:16)
    at org.scalatra.ScalatraContext$class.status(ScalatraContext.scala:29)
    at org.scalatra.ScalatraServlet.status(ScalatraServlet.scala:49)
    at org.scalatra.ScalatraBase$class.runActions$1(ScalatraBase.scala:165)
    at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply$mcV$sp(ScalatraBase.scala:175)
    at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply(ScalatraBase.scala:175)
    at org.scalatra.ScalatraBase$$anonfun$executeRoutes$1.apply(ScalatraBase.scala:175)
    at org.scalatra.ScalatraBase$class.org$scalatra$ScalatraBase$$cradleHalt(ScalatraBase.scala:190)
    at org.scalatra.ScalatraBase$class.executeRoutes(ScalatraBase.scala:175)
    at org.scalatra.ScalatraServlet.executeRoutes(ScalatraServlet.scala:49)
    at org.scalatra.ScalatraBase$$anonfun$handle$1.apply$mcV$sp(ScalatraBase.scala:113)
    at org.scalatra.ScalatraBase$$anonfun$handle$1.apply(ScalatraBase.scala:113)
    at org.scalatra.ScalatraBase$$anonfun$handle$1.apply(ScalatraBase.scala:113)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.DynamicScope$class.withResponse(DynamicScope.scala:80)
    at org.scalatra.ScalatraServlet.withResponse(ScalatraServlet.scala:49)
    at org.scalatra.DynamicScope$$anonfun$withRequestResponse$1.apply(DynamicScope.scala:60)
    at scala.util.DynamicVariable.withValue(DynamicVariable.scala:57)
    at org.scalatra.DynamicScope$class.withRequest(DynamicScope.scala:71)
    at org.scalatra.ScalatraServlet.withRequest(ScalatraServlet.scala:49)
    at org.scalatra.DynamicScope$class.withRequestResponse(DynamicScope.scala:59)
    at org.scalatra.ScalatraServlet.withRequestResponse(ScalatraServlet.scala:49)
    at org.scalatra.ScalatraBase$class.handle(ScalatraBase.scala:111)
    at org.scalatra.ScalatraServlet.org$scalatra$servlet$ServletBase$$super$handle(ScalatraServlet.scala:49)
    at org.scalatra.servlet.ServletBase$class.handle(ServletBase.scala:43)
    at org.scalatra.ScalatraServlet.handle(ScalatraServlet.scala:49)
    at org.scalatra.ScalatraServlet.service(ScalatraServlet.scala:54)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Build errors when I try twitter-demo

Just did a pull, last commit is:

commit 4fe3d02
Author: James Earl Douglas [email protected]
Date: Mon May 30 10:23:11 2011 -0700

extract RefMap into its own class file

I then try the Twitter demo, but get the following errors:

$ sbt

twitter-demo
[info]
[info] == twitter-demo ==
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /Users/ian/workspace/Swarm/swarm-twitter/node1/src/main/scala/swarm/twitter/SwarmTwitter.scala:3: not found: type SwarmTwitterTemplate
[error] class SwarmTwitter extends SwarmTwitterTemplate("node1", 9998, 9997)
[error] ^
[error] /Users/ian/workspace/Swarm/swarm-twitter/node1/src/main/scala/swarm/twitter/SwarmTwitter.scala:3: too many arguments for constructor Object: ()java.lang.Object
[error] class SwarmTwitter extends SwarmTwitterTemplate("node1", 9998, 9997)
[error] ^
[error] two errors found
[info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed.
[info] Compiling main sources...
[error] /Users/ian/workspace/Swarm/swarm-twitter/node2/src/main/scala/swarm/twitter/SwarmTwitter.scala:3: not found: type SwarmTwitterTemplate
[error] class SwarmTwitter extends SwarmTwitterTemplate("node2", 9997, 9998)
[error] ^
[error] /Users/ian/workspace/Swarm/swarm-twitter/node2/src/main/scala/swarm/twitter/SwarmTwitter.scala:3: too many arguments for constructor Object: ()java.lang.Object
[error] class SwarmTwitter extends SwarmTwitterTemplate("node2", 9997, 9998)
[error] ^
[error] two errors found
[info] == twitter-demo ==
[success] Successful.

Create "Swarm-ful" HTTP server library

The ideal Swarm web framework would treat the open HTTP connection to the web browser as just another Swarm object, referenced through a Ref(), but, of course, tied to a specific computer.

This would mean that a HTTP request could come in, and the resultant continuation could move around to other computers, before coming back to the original computer in order to send the HTTP response.

Most existing Java (and Scala?) web frameworks are unsuitable for this, as typically they'll call a method with HTTP request and response objects, but they expect that when this method returns, that the response is ready to be sent. Unfortunately, this method will not typically be within a continuation "reset {}" block.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.