Package

com.eharmony.aloha.semantics.compiled

compiler

Permalink

package compiler

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. compiler
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class Eval extends AnyRef

    Permalink

    Evaluates files, strings, or input streams as Scala code, and returns the result.

    Evaluates files, strings, or input streams as Scala code, and returns the result.

    If target is None, the results are compiled to memory (and are therefore ephemeral). If target is Some(path), the path must point to a directory, and classes will be saved into that directory.

    Eval also supports a limited set of preprocessors. Currently, "limited" means "exactly one": directives of the form #include <file>.

    The flow of evaluation is: - extract a string of code from the file, string, or input stream - run preprocessors on that string - wrap processed code in an apply method in a generated class - compile the class - contruct an instance of that class - return the result of apply()

  2. sealed trait EvalThreadingModel extends AnyRef

    Permalink

    The type of threading model to use for compilation within the com.eharmony.aloha.semantics.compiled.compiler.TwitterEvalCompiler.

  3. case class TwitterEvalCompiler(threadingModel: EvalThreadingModel = SingleThreadedEval, classCacheDir: Option[File] = None, imports: Seq[String] = Nil) extends ContainerReadableByString[Try] with Logging with Product with Serializable

    Permalink

    Compiles code using Twitter's Eval class from util-eval, wrapping the attempt in a Try.

    Compiles code using Twitter's Eval class from util-eval, wrapping the attempt in a Try.

    NOTE: while thread local is a good idea for multi-threading purposes (creates one compiler per thread), one needs to be careful about the number of threads interacting with the compiler. This is true for two reasons: 1 Creation time for compiler instance takes a while. 1 compiler instances are big (translation, many threads + thread local == java.lang.OutOfMemoryError).

    Because the critical sections of the compile function of the StringCompiler.apply(*,*,*) function called by Eval.applyProcessed(*,*,*) are synchronized, we shouldn't need to worry about thread-safety. For more information, see Eval on github.

    threadingModel

    a threading model used for compilation.

    classCacheDir

    Directory where generated class files should be stored.

    imports

    import statements.

    Annotations
    @throws( ... )

Value Members

  1. object SingleThreadedEval extends EvalThreadingModel with Product with Serializable

    Permalink

    Creates a single instance of com.twitter.util.Eval within the com.eharmony.aloha.semantics.compiled.compiler.TwitterEvalCompiler instance.

  2. object ThreadLocalEval extends EvalThreadingModel with Product with Serializable

    Permalink

    Creates an instance of com.twitter.util.Eval per calling thread to the com.eharmony.aloha.semantics.compiled.compiler.TwitterEvalCompiler instance.

Deprecated Value Members

  1. object Eval extends Eval

    Permalink

    Evaluate a file or string and return the result.

    Evaluate a file or string and return the result.

    Annotations
    @deprecated
    Deprecated

    (Since version 1.8.1) use a throw-away instance of Eval instead

Inherited from AnyRef

Inherited from Any

Ungrouped