The high-level interface to the internal broker functionality. The broker agent uses an implementation of this interface. > module QuicQuid.BrokerCore where > import QuicQuid.Router(Address) > import QuicQuid.Term(Term) > import QuicQuid.Logic (Binding) > class BrokerCore brk where > ask :: brk > -> Term -- ^The ask pattern > -> Address -- ^The asking agent address > -- |The matches produced. > -> IO [(Binding -- ^The bindings that make the answer match the ask/query > ,Address -- ^The address of the answer agent > ,Address -- ^The address of the ask agent > )] > answer :: brk > -> Term -- ^The answer pattern > -> Address -- ^The answering agent address > -> IO [(Binding -- ^The bindings that make the answer match the ask/query > ,Address -- ^The address of the answer agent > ,Address -- ^The address of the ask agent > )] The pattern are matched according to the rules set in QuicQuid.Logic. See also the tests in QuicQuid.BrokerTest. TODO: * Add "removeQuery" "removeAnswer" OR assume that query/answer is completed when the receiving channel (where results are sent) is closed. * Fix names: newQuery | newAsk ?