This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-07
Channels
- # admin-announcements (19)
- # announcements (1)
- # beginners (14)
- # boot (244)
- # cider (2)
- # clojure (23)
- # clojure-dev (23)
- # clojure-poland (55)
- # clojure-russia (118)
- # clojure-uk (4)
- # clojurescript (143)
- # core-async (31)
- # core-logic (1)
- # cursive (30)
- # datascript (2)
- # datomic (3)
- # emacs (7)
- # hoplon (40)
- # ldnclj (8)
- # off-topic (2)
- # om (64)
- # reagent (10)
- # ring (1)
- # yada (71)
is there a way to put individual results of map
(vs the entire seq) into the channel returned by go
?
@swizzard: I thought the channel returned by go only had one result?
swizzard: no, the usual way to do this is to create a dedicated out
channel and have the go
block put its values into that, and ignore the value actually put on go
’s return value channel.
is there a pattern for using core.async which is analogous to Q.all() in javascript?
Example: I have an Outfit (collection of maps representing clothing items). Each item must be updated asynchronously, and only once all updates are complete, do something with the "updated" Outfit
Do you have separate go
blocks for each item?
If so, you can just async/merge
their resulting channels into a single channel. If you need to block until all of the merged channels’ values have been delivered on the merged channel, you can use async/into
. Of course, you can do a lot of this manually using go-loop
s and alts!
, too.
thanks, I'll check those out
@erik_price: I am trying to do it that way, not sure what I'm doing wrong
the original-image-dimensions
fn is just doing this: http://stackoverflow.com/questions/623172/how-to-get-image-size-height-width-using-javascript/626505#626505
once I have the height and width of the image, i'm trying to put it to one channel per item
It looks like you create a new Image object, but then it just gets garbage collected. Unless I’m misunderstanding something?
yeah, it's created solely for grabbing the height and width
I see. I’m not a DOM guru, didn’t know that was possible. You’re sure it isn’t being GC’d? Does your onload
callback get executed?
yeah. Before I added the a/into
it was printing out the first value of the result of a/merge
now nothing
I think you want a/map
no, scratch that
I was misreading your code
I dunno Jeremy, it looks right to me
ok, thanks for looking. If I can come up with a good next question, i'll follow up
That implies that not all of the merge
d channels are being closed (because until they are, the channel returned from merge
doesn’t close, and until that closes, into
doesn’t return a channel.
Ok good luck. I’ll be offline for a bit but back later tonight.
that makes sense
does the merge channel itself need to close? is so how would I know when to do it?
it does, but it closes automatically when all of the channels passed to merge
are closed.
ok, thanks
that was it; needed to close the channel onerror
since there was a broken image link in my data