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
/* | |
The code below has io1 io2 io3 that sleep for 2 seconds, 3 seconds and 2 seconds respectivly. | |
I sequence them in order in the for comprension but show how they can be context shifted onto other pools or | |
run concurrently in Fibers. the results are attched to this gist. | |
Note I use IOApp rather than App which automatically runs the run function to get the IO then calls runUnsafe on it | |
*/ | |
package kfoo | |
import java.util.concurrent.Executors |
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
// when env = "dev" | |
// and I have a file called ./src/main/resources/application-dev.conf on my classpath | |
def forEnvironment(env: String): Configuration = { | |
val envSpecificConfigPath = "/application-" + env + ".conf" | |
val conf = | |
if (getClass.getResource(envSpecificConfigPath) != null && | |
System.getProperty("config.resource") == null && | |
System.getProperty("config.file") == null) { | |
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
2019/08/28 17:09:18 [INFO] Terraform version: 0.12.6 | |
2019/08/28 17:09:18 [INFO] Go runtime version: go1.12.4 | |
2019/08/28 17:09:18 [INFO] CLI args: []string{"/usr/local/terraform/0.12.6/terraform", "plan"} | |
2019/08/28 17:09:18 [DEBUG] Attempting to open CLI config file: /home/robertk/.terraformrc | |
2019/08/28 17:09:18 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2019/08/28 17:09:18 [INFO] CLI command args: []string{"plan"} | |
2019/08/28 17:09:18 [TRACE] Meta.Backend: built configuration for "s3" backend with hash value 3758110317 | |
2019/08/28 17:09:18 [TRACE] Preserving existing state lineage "6afd498b-1a91-c1a4-e20b-b257e7469445" | |
2019/08/28 17:09:18 [TRACE] Preserving existing state lineage "6afd498b-1a91-c1a4-e20b-b257e7469445" | |
2019/08/28 17:09:18 [TRACE] Meta.Backend: working directory was previously initialized for "s3" backend |
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
#!/bin/bash | |
##### | |
# Launch and time python and node scripts that also launch subprocesses | |
echo start launch python data subprocess... | |
date "+%T %s %N" | |
python mypydatesub.py | |
echo | |
echo start launch python compiled data subprocess... | |
date "+%T %s %N" |