CrossClj

0.2.3 docs

SourceDocs



RECENT
    VARS
    apply-router!
    process-unhandled-message
    try-handler
    try-to-process-message
    valid-api-message?

    « Index of all namespaces of this project

    Utility functions shared by multiple API router implementations.
    
    (apply-router! source-channel router)
    Given a core.async channel that produces API messages, passes them
    to the given IAPIRouter as they arrive.
    TODO: Concurrency
    (process-unhandled-message component message)
    (try-handler f message)
    Given a function and an API message, runs the function with the
    message payload as its argument.
    
    If the message defines a :reply-to address and the handler returns a
    truthy value, replies to the :reply-to address with the
    result. :correlation-id will be set if given in the incoming
    message.
    
    If there are any errors, logs them and attempts to put the message
    on the DLQ.
    (try-to-process-message component message)
    Shared implementation for IAPIRouter's process-message! call. Tries
    to look up the appropriate handler using handler-for-call. If found,
    runs the handler.
    (valid-api-message? message)
    Inspects the given message and returns whether it is a valid
    Bureaucrat API format message.