diff --git a/src/Foreign/JavaScript.hs b/src/Foreign/JavaScript.hs index 65ce2823..d61dfe6f 100644 --- a/src/Foreign/JavaScript.hs +++ b/src/Foreign/JavaScript.hs @@ -30,7 +30,7 @@ module Foreign.JavaScript ( ) where import Control.Concurrent.STM as STM -import Control.Monad (unless,when) +import Control.Monad (unless) import qualified Data.Aeson as JSON import Foreign.JavaScript.CallBuffer import Foreign.JavaScript.EventLoop @@ -38,8 +38,6 @@ import Foreign.JavaScript.Marshal import Foreign.JavaScript.Server import Foreign.JavaScript.Types import Foreign.RemotePtr as Foreign -import Data.Time -import Data.Maybe(isJust) {----------------------------------------------------------------------------- Server @@ -66,8 +64,7 @@ serve config init = httpComm config $ eventLoop $ \w -> do -- it can be buffered and sent to the browser window at a later time. -- See 'setCallBufferMode' and 'flushCallBuffer' for more. runFunction :: Window -> JSFunction () -> IO () -runFunction w f = do - bufferRunEval w =<< toCode f +runFunction w f = bufferRunEval w =<< toCode f -- | Run a JavaScript function that creates a new object. -- Return a corresponding 'JSObject' without waiting for the browser diff --git a/src/Foreign/JavaScript/EventLoop.hs b/src/Foreign/JavaScript/EventLoop.hs index dd38c7c1..aac4e9cb 100644 --- a/src/Foreign/JavaScript/EventLoop.hs +++ b/src/Foreign/JavaScript/EventLoop.hs @@ -57,7 +57,6 @@ eventLoop init server comm = void $ do -- The thread `multiplexer` reads from the client and -- sorts the messages into the appropriate queue. events <- newTQueueIO - lastwrite <- newTVarIO Nothing results <- newTQueueIO :: IO (TQueue Result) -- The thread `handleCalls` executes FFI calls -- from the Haskell side in order. @@ -125,21 +124,7 @@ eventLoop init server comm = void $ do result <- readTQueue results putTMVar ref result Nothing -> return () -<<<<<<< HEAD -||||||| parent of 742e75f... mend - let flushTimeout = forever (do - v <- flushDirtyBuffer comm w - case v of - Left i -> threadDelay (i *1000) - Right (i,code') -> do - runEval w $ code' [] - threadDelay (i *1000) - ) - -======= - ->>>>>>> 742e75f... mend -- Receive events from client and handle them in order. let handleEvents = do me <- atomically $ do diff --git a/src/Foreign/JavaScript/Types.hs b/src/Foreign/JavaScript/Types.hs index 8e2278b5..c5a86c65 100644 --- a/src/Foreign/JavaScript/Types.hs +++ b/src/Foreign/JavaScript/Types.hs @@ -73,7 +73,6 @@ data Config = Config -- @Nothing@ means that the port number is -- read from the environment variable @PORT@. -- Alternatively, port @8023@ is used if this variable is not set. ->>>>>>> a2dff44... force flush of buffer , jsAddr :: Maybe ByteString , jsCustomHTML :: Maybe FilePath , jsStatic :: Maybe FilePath