This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"labels": "app:helloworld", | |
"type": "service", | |
"published" : { | |
"access": "affini-tech", | |
"prefix": "/helloworld/" | |
}, | |
"name": "helloworld", | |
"image-destination": "eu.gcr.io/datataskio/hello_world:0.1", | |
"image-pull-policy": "Always", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name":"my_pipeline", | |
"original":"pipeline_example", | |
"tasks":[ | |
{ | |
"name" :"job1", | |
"namespacetask":"quick_start/job_sleep" | |
}, | |
{ | |
"name" :"job2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"labels": "app:fibonacci", | |
"type": "job", | |
"name": "fibonacci", | |
"image-destination": "eu.gcr.io/datataskio/fibonacci:0.1", | |
"cmd": ["python","/code/fibbo.py","10"], | |
"cpu-limit": "0.20", | |
"memory-limit": "200Mi", | |
"cpu-request": "0.15", | |
"memory-request": "150Mi", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment(); | |
env.enableCheckpointing(5000); // checkpoint every 5000 msecs | |
env.setParallelism(2); // 2 workers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val route = | |
path("req") { | |
get { | |
parameter("name") { name => | |
requestActor ! Req(name) | |
complete(s"Request sent for $name ! ") | |
} | |
} | |
} ~ | |
path("reqresp") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val route = | |
path("hello") { | |
get { | |
parameter("name") { (name) => | |
complete(s"Hello $name !") | |
} | |
} ~ | |
post { | |
parameter("name") { (name) => | |
complete(s"Posting $name !") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.server.Directives._ | |
import akka.stream.ActorMaterializer | |
object Main extends App { | |
implicit val system = ActorSystem("HelloSystem") | |
implicit val materializer = ActorMaterializer() | |
implicit val executionContext = system.dispatcher |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class TestPage extends Component { | |
constructor(props) { | |
super(props); | |
// .... | |
this.processResponse = this.processResponse.bind(this); | |
} | |
processResponse(jsonObject){ | |
console.log("processing...") | |
console.log(jsonObject[0]['username']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// on the top of the hierarchy define a collector actor | |
val collector = system.actorOf(Props[CollectorActor], name = "collector") | |
// in all the routed actors insert this to send results | |
context.actorSelection("/user/collector") ! Response(s"(SecondActor:$t)") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FirstActor() extends Actor { | |
def receive = { | |
case Msg(t) => { | |
??? | |
} } } | |
object Main extends App { | |
val system = ActorSystem("HelloSystem") | |
val a1 = system.actorOf(Props[FirstActor], name = "a1") | |
val a2 = system.actorOf(Props[FirstActor], name = "a2") |
NewerOlder