• Places
    • Home
    • Graphs
    • Prefixes
  • Admin
    • Users
    • Settings
    • Plugins
    • Statistics
  • CPACK
    • Home
    • List packs
    • Submit pack
  • Repository
    • Load local file
    • Load from HTTP
    • Load from library
    • Remove triples
    • Clear repository
  • Query
    • YASGUI SPARQL Editor
    • Simple Form
    • SWISH Prolog shell
  • Help
    • Documentation
    • Tutorial
    • Roadmap
    • HTTP Services
  • Login

A.5 library(broadcast): Broadcast and receive event notifications
All Application Manual Name SummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(broadcast): Broadcast and receive event notifications
          • broadcast/1
          • broadcast_request/1
          • listen/2
          • listen/3
          • unlisten/1
          • unlisten/2
          • unlisten/3
          • listening/3
    • Packages
Availability::- use_module(library(broadcast)).(can be autoloaded)
Sourcelisten(+Template, :Goal)
Register a listen channel. Whenever a term unifying Template is broadcasted, call Goal. The following example traps all broadcasted messages as a variable unifies to any message. It is commonly used to debug usage of the library.
?- listen(Term, (writeln(Term),fail)).
?- broadcast(hello(world)).
hello(world)
true.
ClioPatria (version V3.1.1-51-ga0b30a5)