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
# set up flags for Numpy C extentions compiling | |
export CFLAGS="-arch i386 -arch x86_64" | |
export FFLAGS="-m32 -m64" | |
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch x86_64" | |
export CC=gcc-4.2 | |
export CXX="g++ -arch i386 -arch x86_64" | |
pip install numpy | |
# success! |
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 scala.concurrent.duration._ | |
import scala.concurrent.ExecutionContext | |
import scala.concurrent.Future | |
import akka.pattern.after | |
import akka.actor.Scheduler | |
/** | |
* Given an operation that produces a T, returns a Future containing the result of T, unless an exception is thrown, | |
* in which case the operation will be retried after _delay_ time, if there are more possible retries, which is configured through | |
* the _retries_ parameter. If the operation does not succeed and there is no retries left, the resulting Future will contain the last failure. |