Commits

Jeffrey Stoffers committed 7f8bec5

JVM tuning

Comments (0)

Files changed (3)

 .lein-failures
 .lein-plugins
 .lein-repl-history
+log.txt
 (defproject purplebot "0.1.0-SNAPSHOT"
   :description "FIXME: write description"
   :url "http://example.com/FIXME"
+  :main purplebot.core
+  :jvm-opts ["-Xmx32M" "-Xms32M"]
   :license {:name "Eclipse Public License"
             :url "http://www.eclipse.org/legal/epl-v10.html"}
   :dependencies [[org.clojure/clojure "1.5.1"]

src/purplebot/core.clj

   [fun]
   (fn [i m s c w] (fun i m s c w)))
 
-(def privmsg-commands
-  {:tacocat (wrap-function tacocat)
-   :command (wrap-function add-command)
-   :reset (fn [i m s c w] (restart-bot))})
-
 (defn add-privmsg-command
   [k f]
   (message server "#bots" (str k " -> " f))
       (add-privmsg-command k (load-string f))
       )))
 
+(def privmsg-commands
+  {:tacocat (wrap-function tacocat)
+   :command (wrap-function add-command)
+   :reset (fn [i m s c w] (restart-bot))})
+
 (defn add-callback
   "Add a callback to the irc object for handler and run function"
   [i h f]
          (((keyword command) privmsg-commands) i m src command (rest words))
          :else (message i (:target m) "Unrecognized command"))))))
 
-(add-callback server :privmsg (fn [i m] (privmsg-parse i m)))
-(add-callback server :raw-log (fn [i t s] (log-to-tmp i t s)))
+(defn -main
+  ""
+  []
+  (restart-bot)
+  (add-callback server :privmsg (fn [i m] (privmsg-parse i m)))
+  (add-callback server :raw-log (fn [i t s] (log-to-tmp i t s))))