Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Wiki questions / clarification requests #13

Closed
trptcolin opened this issue Oct 1, 2011 · 1 comment
Closed

Wiki questions / clarification requests #13

trptcolin opened this issue Oct 1, 2011 · 1 comment

Comments

@trptcolin
Copy link

The code examples are using Clojure 1.2 and lamina-0.4.0-beta2.jar (running out of a recent Aleph checkout).

From the Channels wiki:

  • "Any attempt to consume messages from a drained channel will return false." But when I run the examples locally, I get true. Not sure if it's me, the wiki, or "other" with the problem:
user=> (def ch (channel))
#'user/ch
user=> (enqueue ch 1)
true
user=> (close ch)
true
user=> ch
<== [1]
user=> (receive ch println)
1
true
user=> (drained? ch)
true
user=> (receive ch println)
true
  • "..if there are no messages queued up in the channel when close is called, a final nil message will be enqueued. All functions which operate on channels ignore this trailing nil." I might be missing something here, but:
user=> (def ch (channel))
#'user/ch
user=> (close ch)
true
user=> ch
<== [nil]
user=> (receive ch #(println "ohai:" %))
ohai: nil
true

Those two might be different views of the same question, not sure.

  • The constant-channels section might use a mention that you'd presumably never use receive-all w/ a constant-channel, since only one message gets taken, as receive does in normal cases. Or maybe some other explanation if I'm missing something :)

From the Pipelines wiki

  • Should the poll-result namespace (I assume lamina.core.pipeline get used here? In general, this one was a bit harder to follow because of the abstract examples. I might be abnormal in wanting to type everything in and play with it, but that'd be cool.

From the Async Programming wiki

  • There's a "not complete" heading there at the bottom - not sure what needs filling out, but thought I'd point that out since I'm in here.

Awesome stuff

Seriously man, it's been a joy to read through these docs. As you know, most OSS doesn't have docs anywhere near this good :)

@ztellman
Copy link
Owner

ztellman commented Oct 2, 2011

The receive return value is a regression I wasn't testing for. Thanks for catching that.

'receive' and 'receive-all' are equivalent for constant channels, but it's fine to use either.

The pipeline wiki needs to be reworked, I think. With (async ...) to support the simpler workflows, I think it will be more targeted to people wanting a more specific or higher performance implementation.

And the async programming wiki is just half-finished. I'll get around to it soon.

@ztellman ztellman closed this as completed Oct 2, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants