         console.log err
   compileFile: (file, options, callback)->
     ext = file.path.split(".").pop()
-    newContent = fs.readFileSync file.path, 'utf-8' #,(err,newContent)=>
-    # if err
-    #   console.log err
-    #   throw new Error "Couldn't open #{file.path}"
-    #   process.exit()
-    # else
-    switch ext
-      when "styl"
-        stylus(newContent).set('compress',true).use(nib()).render (err,css)=>
-          unless err
-            file.contents = css
-            writeCacheFile file.path,css
-            callback file
-          else
-            log.info "error with styl file at #{file.path}"
-      when "coffee"
-
-        try
-          file.contentsCs = newContent
-          # if file.section is "Client"
-          #   file.contents = postProcess source:(cs.compile newContent,bare:yes)
-          #   # log.debug file.contents
-          # else
-          file.contents = cs.compile newContent,bare:yes
-          writeCacheFile file.path,file.contents
-
-
-
-          #file.contents = @uglify js:file.contents,mangle:no,noMangleFunctions:yes,squeeze:no #,beautify:beautify
-        catch error
-          errd = yes
-          log.error "#{(error.stack.split "\n")[0]} at: #{file.path}"
-          @emit "CoffeeScript Compile Error",file.path,(error.stack.split "\n")[0]
-
-
-        callback file
-        @emit "coffeeFileContents",file # for sourceCodeAnalyzer.
-      else
-        file.contents = newContent
-        callback file
+
+    queue.push
+      path     : file.path
+      encoding : 'utf8'
+    , (err, newContent) =>
+
+      switch ext
+        when "styl"
+          stylus(newContent).set('compress',true).use(nib()).render (err,css)=>
+            unless err
+              file.contents = css
+              writeCacheFile file.path,css
+              callback file
+            else
+              log.info "error with styl file at #{file.path}"
+        when "coffee"
+          try
+            file.contentsCs = newContent
+            # if file.section is "Client"
+            #   file.contents = postProcess source:(cs.compile newContent,bare:yes)
+            #   # log.debug file.contents
+            # else
+            file.contents = cs.compile newContent,bare:yes
+            writeCacheFile file.path,file.contents
+
+
+
+            #file.contents = @uglify js:file.contents,mangle:no,noMangleFunctions:yes,squeeze:no #,beautify:beautify
+          catch error
+            errd = yes
+            log.error "#{(error.stack.split "\n")[0]} at: #{file.path}"
+            @emit "CoffeeScript Compile Error",file.path,(error.stack.split "\n")[0]
+
+
+          callback file
+          @emit "coffeeFileContents",file # for sourceCodeAnalyzer.
+        else
+          file.contents = newContent
+          callback file
 
 module.exports  = Watcher
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-

          # @writeCache newFile,(err)->
          callback file, newFile
      else
        # console.log "reading"+file.path
        fs.readFile file.cachePath,'utf8',(err,data)->
          # console.log 'serving from cache',file.cachePath
          file.lastCompile = Date.now()
          file.contents = data

ProgressBar     = require './node_modules/progress'
#{parser, uglify}  = require "uglify-js"
hat             = require "./node_modules/hat"
async           = require "async"
# {postProcess}   = require "pistachio-compiler"
# qfunction      = require 'qfunction'

queue = async.queue((task, callback) ->
  fs.readFile task.path, task.encoding, (err,data)->
    callback null, data
, 100)

class Watcher extends EventEmitter
  constructor:(filelistPath)->
