diff options
author | Julien Dessaux | 2010-05-29 23:48:47 +0200 |
---|---|---|
committer | Julien Dessaux | 2010-05-29 23:55:20 +0200 |
commit | 3410caa6f2e1fd74d55f7a1717420bb2e1052b12 (patch) | |
tree | 214cb220de340eada4141479ae6415e654a4fdc3 /Hsbot/Irc/Types.hs | |
parent | Added signal handling and a better semantic for bot status. (diff) | |
download | hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.tar.gz hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.tar.bz2 hsbot-3410caa6f2e1fd74d55f7a1717420bb2e1052b12.zip |
Fixed the plugin termination.
The master of a plugin will now wait for the plugin it kills to terminate.
Diffstat (limited to 'Hsbot/Irc/Types.hs')
-rw-r--r-- | Hsbot/Irc/Types.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Hsbot/Irc/Types.hs b/Hsbot/Irc/Types.hs index fe70ea4..4b75085 100644 --- a/Hsbot/Irc/Types.hs +++ b/Hsbot/Irc/Types.hs @@ -3,6 +3,7 @@ module Hsbot.Irc.Types , IrcBotState (..) , IrcServer , IrcServerState (..) + , first ) where import Control.Concurrent @@ -22,7 +23,7 @@ type IrcBot = StateT IrcBotState IO -- | An Ircbot state data IrcBotState = IrcBotState { ircBotStartTime :: UTCTime -- the bot's uptime - , ircBotPlugins :: M.Map String (IrcPluginState, ThreadId) -- Loaded plugins + , ircBotPlugins :: M.Map String (IrcPluginState, MVar (), ThreadId) -- Loaded plugins , ircBotCommands :: M.Map String [String] -- Loaded plugins , ircBotChan :: Chan IrcBotMsg -- The IrcBot's communication channel , ircBotMasterChan :: Chan BotMsg -- The Hsbot communication channel @@ -44,3 +45,6 @@ data IrcServerState = IrcServerState , ircServerChan :: Chan IrcBotMsg -- the IrcBot channel } +-- | Utilities for triplets +first :: (a, b, c) -> a +first (a, _, _) = a |