Hi all, This is my first post here so please be compassionate :)
I'm evaluating clojure for some of my purposes and I've stuck on task that I don't know to handle. I have applicatin that is receiving a lot of data and writing some results to a file. However once per hour this output file must be changes so data are in chunks. I have working solution with writing to one file but I don't know where to start code for changeing "this on the fly". What I need is to avoid open-close cycle with every piece of data to save since data stream is big.I need only close one file and open another one (name generated on some rules) where data will be continously written once per hour. I have this app written in golang where there are just two goroutines and main code retriving data. Writing goroutine beside data to write channel also have filename channel and when it receives message here it just close current file and open another but file handle var (i.e outFile) is always the same. This file swap is made with mutex arround and other protection so there is no case when write is made to a closed file. There is another timer goroutine that every ~ยง1h just calculate new filename and sends message to write goroutine. Works like expected :) As a proof of concept I'm trying to rewrite this in clojure. Summary it's like kind of syslog which have to change destination file periodically. Kind regards to everyone. Marcin. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.