Uploaded image for project: 'PuppetDB'
  1. PuppetDB
  2. PDB-1465

PR (1372): (maint) Detangle query-eng database and http streaming - ajroetker

    Details

    • Type: Task
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: PDB 3.0.0
    • Component/s: None
    • Labels:
    • Template:
    • Story Points:
      1
    • Sprint:
      PuppetDB 2015-05-06, PuppetDB 2015-05-20

      Description

      (maint) Detangle query-eng database and http streaming

      Pull Request Description


      This commit addresses the "callback hell" of the query_eng.clj. Prior to
      this commit the query-eng stream-query-result function had an output-fn
      arguement whose interface was as follows, "output-fn takes a function
      (f) as an argument and applies that funtion to another function (g),
      (g) must realize the values of a lazy sequence of database rows."
      This was primarily do to the fact the we need to stream results from the
      database as well as stream results of http, which had to be done in a
      separate thread. Another layer of complexity was that the http streaming
      that we did also needed access to the count-query vector only available
      int the stream-query result vector. All this complexity makes it very
      confusing developing callbacks for querying puppetdb in process
      directly, such as from PE extensions. This commit moves the http
      streaming up a functional layer into produce-streaming body, passing
      stream-query-result a promise to retrieve the count-query.


      (webhooks-id: f057e4fbbbf4ec29d8053021a9487c24)

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Unassigned
                Reporter:
                gepetto-bot gepetto-bot
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: