Package

erl-simplebus

Repository
id3as/purescript-erl-simplebus
Uploaded by
nwolverson

Very simple message bus built on top of Gproc (and as such that dependency needs adding to rebar.config)

    data BookEvent = BookCreated Isbn
               | BookUpdated Isbn
               | BookDeleted Isb

    bus :: SimpleBus.Bus String BookEvent
    bus = SimpleBus.bus "book_library"
   SimpleBus.raise bus (BookCreated book.isbn)
   
  _ <- SimpleBus.subscribe BookLibrary.bus handleMessage
  
  handleMessage :: BookEvent :: Effect Unit
  handleMessage ev = pure unit
  
Modules
SimpleBus
Dependencies