Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README updated to use redlobster.promise instead of redlobster.macro #2

Merged
merged 1 commit into from
Feb 20, 2013

Conversation

olenhad
Copy link
Contributor

@olenhad olenhad commented Feb 20, 2013

The promise macro doesn't realize the form passed to it.
In redlobster.macro:

(defmacro promise
  "Return a promise that will be realised by the given forms. The functions
`realise` and `realise-error` will be available inside the macro body, and one
of these should be called at some point within the forms to realise the promise."
  [& forms]
  `(let [promise# (redlobster.promise/promise)
         realise# (fn [promise# value#]
                    (redlobster.promise/realise promise# value#))
         realise-error# (fn [promise# value#]
                          (redlobster.promise/realise-error promise# value#))
         ~'realise (partial realise# promise#)
         ~'realise-error (partial realise-error# promise#)]
;; forms is never passed to redlobster.promise to realise
     ~@forms
     promise#))

This is why I believe I get a timeout when I use this macro as a handler:

(defn handler [request]
      (promise {...}))
(run-http-server handler )

bodil added a commit that referenced this pull request Feb 20, 2013
README updated to use redlobster.promise instead of redlobster.macro. Closes #1.
@bodil bodil merged commit 2e06925 into whamtet:master Feb 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants