Follow the Installation instructions below to create your environment for developing SWIM applications.
Refer to the SWIM developer site for an overview of SWIM concepts.
We highly recommend that you go through at LEAST the basics tutorial to see how these concepts manifest themselves in a real SWIM application.
-
Install JDK 8. Ensure that your JAVA_HOME environment variable is pointed to the Java 8 installation location. Ensure that your PATH includes $JAVA_HOME.
-
Refer to the sample build.gradle for reference. You may use this build.gradle for all your applications.
-
To build the application execute the command
./gradlew buildfrom a shell pointed to the application's home directory. This will create a.zipand a.tarinAPP_HOME/build/distributionsdirectory. Unpackage the.zipor the.tarfile. The unpackaged contents will contain abin/directory which contains scripts that can be used to run the application.user@machine:~$ ./gradlew run
-
Alternatively, if you don't mind running through the Gradle VM, execute the command
./gradlew run. This will both build and run the application.user@machine:~$ ./gradlew run
SWIM is an eventually consistent, real-time, distributed object system. The building blocks of a SWIM server are Services, Lanes, Links, and a single Plane, where
Servicesare objectsLanesare the fields and methods, ofServicesLinksare references toLanesinServices- The
Planeis a collection ofServicedefinitions.
Public Services and Lanes form a SWIM API (streaming API over web-sockets).
We again refer you to the [SWIM developer site](SWIM developer site for a detailed overview of these SWIM concepts.
There are just three steps to build a SWIM Application.
- Write SWIM
Serviceswith appropriateLanedeclarations and configurations - Define a
Planewith allServiceTypefields appropriately declared and all desired configurations loaded - Ingest data into
LanesusingcommandsorDownlinks, via either aSwimClientinstance or an external program
That's it! Services spawn lazily when a URI associated with a Service or Lane instance is invoked for the first time, so SWIM Services will process data immediately upon its availability without requiring their explicit instantiation.
Visit the following tutorials to see concrete applications built through these steps.