Thread pools on the JVM should usually be divided into the following three categories:
- CPU-bound
- Blocking IO
- Non-blocking IO polling
Each of these categories has a different optimal configuration and usage pattern.
# This is heavily based in the code here: | |
# https://gist.github.com/enpassant/0496e3db19e32e110edca03647c36541 | |
# Special thank you to the user enpassant for starting it https://github.com/enpassant | |
#!/bin/bash | |
SYNTAX="$2" | |
EXTENSION="$3" | |
OUTPUTDIR="$4" | |
INPUT="$5" |
dependencies: | |
cache_directories: | |
- "~/.stack" | |
pre: | |
- wget https://github.com/commercialhaskell/stack/releases/download/v0.1.2.0/stack-0.1.2.0-x86_64-linux.gz -O /tmp/stack.gz | |
- gunzip /tmp/stack.gz && chmod +x /tmp/stack | |
- sudo mv /tmp/stack /usr/bin/stack | |
override: | |
- stack setup | |
- stack build |
#!/bin/bash | |
# | |
# What is that | |
# ============ | |
# | |
# This script will help you setting up your digital ocean | |
# infrastructure with Ansible v2.0+ and DO API v2 | |
# | |
# Usually, when working with DO, one is supposed to use digital_ocean.py | |
# inventory file, and spin up instances in a playbook. |
(comment | |
This is the easiest and most concise way of calling an external process in Java. The inheritIO methods causes the command to output stdout and errout to the same place as your current process (which most of the times is the console), no need to create mechanisms for reading asynchronously from input streams to get at the information. | |
http://docs.oracle.com/javase/7/docs/api/java/lang/ProcessBuilder.html | |
) | |
(def ret (.waitFor (-> (ProcessBuilder. ["gzip" "-t" "g.txt.gz"]) .inheritIO .start))) | |