Сегодня увидел что обновились версии пакетов для Cloud Haskell Platform.
В hackage изменения пока не попали, судя по всему готовят документацию.
Пока суть да дело, полез посмотреть по коду что нового.
В наборе теперь:
Genserver
Сильно смахивает на аналог из OTP, но естественно со своей спецификой, API простое, уже есть примеры в документации.
Supervisor
Аналогично, только пока нет документации, нужно смотреть код.
Что реализованно можно глянуть в шапке
Message Exchanges
12345678
---- The concept of a /message exchange/ is borrowed from the world of-- messaging and enterprise integration. The /exchange/ acts like a kind of-- mailbox, accepting inputs from /producers/ and forwarding these messages-- to one or more /consumers/, depending on the implementation's semantics.---- This module provides some basic types of message exchange and exposes an API-- for defining your own custom /exchange types/.
Из коробки broadcast, router, custom.
Документация в процессе, смотреть код.
EventManager
1234
-- The /EventManager/ is a parallel/concurrent event handling tool, built on-- top of the /Exchange API/. Arbitrary events are published to the event-- manager using 'notify', and are broadcast simulataneously to a set of-- registered /event handlers/.
-- This module provides a general purpose logging facility, implemented as a-- distributed-process /Management Agent/. To start the logging agent on a-- running node, evaluate 'systemLog' with the relevant expressions to handle-- logging textual messages, a cleanup operation (if required), initial log-- level and a formatting expression.
-- The module provides an extended process registry, offering slightly altered-- semantics to the built in @register@ and @unregister@ primitives and a richer-- set of features:---- * Associate (unique) keys with a process /or/ (unique key per-process) values-- * Use any 'Keyable' algebraic data type as keys-- * Query for process with matching keys / values / properties-- * Atomically /give away/ names-- * Forceibly re-allocate names to/from a third party---- [Subscribing To Registry Events]---- It is possible to monitor a registry for changes and be informed whenever-- changes take place. All subscriptions are /key based/, which means that-- you can subscribe to name or property changes for any process, so that any-- property changes matching the key you've subscribed to will trigger a-- notification (i.e., regardless of the process to which the property belongs).
Monitoring
Мониторинг нод
123456
-- This module provides a primitive node monitoring capability, implemented as-- a /distributed-process Management Agent/. Once the 'nodeMonitor' agent is-- started, calling 'monitorNodes' will ensure that whenever the local node-- detects a new network-transport connection (from another cloud haskell node),-- the caller will receive a 'NodeUp' message in its mailbox. If a node-- disconnects, a corollary 'NodeDown' message will be delivered as well.
BlockingQueue
12345678910111213
-- A simple bounded (size) task queue, which accepts requests and blocks the-- sender until they're completed. The size limit is applied to the number-- of concurrent tasks that are allowed to execute - if the limit is 3, then-- the first three tasks will be executed immediately, but further tasks will-- then be queued (internally) until one or more tasks completes and-- the number of active/running tasks falls within the concurrency limit.---- Note that the process calling 'executeTask' will be blocked for _at least_-- the duration of the task itself, regardless of whether or not the queue has-- reached its concurrency limit. This provides a simple means to prevent work-- from being submitted faster than the server can handle, at the expense of-- flexible scheduling.--
Туда же Asunc, Timer, Time, и различные хэлперы.
Не знаю как кому, но мне API в том виде что уже есть, нравится.
К сожалению времени на попробовать в ближайшие 2 недели у меня не предвидится,
буду заниматься плановым переносом сервисов в другой датацентр.
Для желающих затестить, help по установке:
ghc-7.6.3