[{"data":1,"prerenderedAt":148},["ShallowReactive",2],{"project-12560234":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":37,"post_text":29,"what":38,"said":48,"maker_in_thread":85,"shape":94,"grid":98,"attempts":111,"same_week":112,"maker_shows":34,"maker_hidden":141,"reader_version":142,"card":143},"12560234","goworkqueue","Super Simple Worker Queue in Go","title","Show HN: Super Simple Worker Queue in Go","https:\u002F\u002Fgithub.com\u002FXeoncross\u002Fgoworkqueue","github.com","Xeoncross",1474577175,2016,6,7,2062,2264,92,"shown","languages","concurrency library","library",[24,25,26,27],"go","worker queue","goroutines","buffered channel","quiet",null,{"positive":31,"neutral":32,"mixed":31,"critical":33},0,2,1,3,{"design":36},{"positive":31,"critical":33},[31,31,34,31,33,31,34],{"problem":29,"audience":29,"pricing":29,"motivation":29,"time_to_build":29,"stack":39,"openness":47,"stage":47,"team_size":47},[40],{"value":41,"source":42,"evidence":43},"Go","maker",[44],{"id":45,"by":11,"text":46},"12571296","Maybe I'm missing something, but that is how I'm doing it. The Queue struct has a 'Queue.Jobs chan string' that is the public method for adding to the \"Queue\" and then the go…","unknown",{"praise":49,"objections":50,"requests":69,"questions":75,"alternatives":80},[],[51,62],{"value":52,"source":53,"evidence":54},"Buffered channel imposes a fixed maximum queue size; suggested unbounded linked-list backing","commenter",[55,59],{"id":56,"by":57,"text":58},"12561831","gravypod","Could you implement this with a linked list underneath to remove the max queue size?",{"id":60,"by":57,"text":61},"12573410","Ok well then can you back it by a linked list? That way there is no size.",{"value":63,"source":53,"evidence":64},"Channels are already FIFO queues; the wrapper may be unnecessary",[65],{"id":66,"by":67,"text":68},"12561872","kixpanganiban","Channels are inherently FIFO queues. So why not just use the usual `select`\u002F`case` method and cast the `struct` you need into a chan with `make(chan, struct)`? See:…",[70],{"value":71,"source":53,"evidence":72},"Back the queue with a linked list so there is no size limit",[73,74],{"id":56,"by":57,"text":58},{"id":60,"by":57,"text":61},[76],{"value":77,"source":53,"evidence":78},"Why buffer the channel instead of using select with non-blocking send",[79],{"id":66,"by":67,"text":68},[81],{"value":82,"source":53,"evidence":83},"Plain Go channels with select and non-blocking operations",[84],{"id":66,"by":67,"text":68},{"comments":34,"answered":32,"key":86},[87,90,93],{"id":88,"text":89},"12565135","Are you talking about doing this instead of buffering the channel? The reason I buffer it is because I don't want whatever is providing the worker with a message to block while…",{"id":91,"text":92},"12565149","So a mutex-protected list that feeds the queue?",{"id":45,"text":46},{"commenters":34,"max_depth":95,"maker_replies":34,"first_comment_mins":96,"lifespan_hours":97},5,316,53,[99,101,103,105,106,109,110],[66,31,31,100,67,31],"commenter\u002Fcritical\u002Fdesign",[88,31,31,102,11,33],"commenter\u002Fneutral\u002Fdesign",[56,33,34,104,57,31],"project\u002Fneutral\u002Fdesign",[91,33,31,104,11,33],[107,33,33,108,57,31],"12568630","project\u002Fcritical\u002Fdesign",[45,33,31,104,11,33],[60,33,34,104,57,31],[],[113,118,122,127,131,136],{"id":114,"name":115,"points":116,"category":117},"12571200","InstaPart",309,"dev_tools",{"id":119,"name":120,"points":121,"category":20},"12572412","G9.js",237,{"id":123,"name":124,"points":125,"category":126},"12589538","fgmk",215,"games",{"id":128,"name":129,"points":130,"category":117},"12588897","Material Design for Bootstrap",164,{"id":132,"name":133,"points":134,"category":135},"12564410","days",156,"productivity",{"id":137,"name":138,"points":139,"category":140},"12584380","Alooma Live",144,"data",false,"v2",{"id":144,"name":5,"line":6,"ai":141,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":145,"maker":11,"domain":10,"tier":19,"attempts":31,"strip":146,"url":9,"mix":147,"praise":-1,"objection":52,"sub":21},12560234,[24,25,26,27],"0030103",[31,32,31,33],1793990947936]