Camelia, the Perl 6 bug

IRC log for #mojo, 2013-02-09

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 sri the naming thing is about compund indexes apparently
00:00 sri *compund
00:00 sri argh
00:00 sri compound
00:01 sri indexes are created with an insert into a special system collection
00:05 sri ah, i'm starting to understand
00:05 sri the array bullshit is for order of names, to generate the same name for multiple ensure_index calls
00:06 sri {foo => 1, bar => 1}... with random order you get two indexes... foo_bar and bar_foo
00:06 jberger how can to_index_string even possibly work
00:07 jberger each(%$arrayref) ?
00:07 jberger surely that has to die
00:07 sri jberger: i'm trying not to think about details like that when reviewing that dist :D
00:07 * jberger waits for someone to use airplane ...
00:08 sri rafl might have done a good job when he first wrote the dist, but in the meantime it seems to have gotten completely butchered
00:08 jberger I'm sure they meant each($hash_or_arrayref)
00:09 jberger and require whatever version that is
00:09 jberger 5.14?
00:09 jberger and no one has seen that it got borked
00:09 jberger whatever
00:09 sri it apparently requires 5.10 only
00:10 jberger I'm sure sri will do better
00:10 jberger :-)
00:10 sri they set the bar pretty low ;p
00:14 sri i really really hope they will make this change https://jira.mongodb.org/browse/SERVER-1594
00:14 sri then i could completely ignore replica sets
00:16 Molaf_ joined #mojo
00:17 jberger Created: Aug 09 2010
00:18 sri it's a top10 issue though, they care about votes on feature requests
00:19 sri full text search was #2 for like 3 years
00:19 sri now it's in the latest dev release
00:27 sri on the official feature list we are already pretty good http://docs.mongodb.org/meta-driver/latest/l​egacy/feature-checklist-for-mongodb-drivers/
00:27 sri only ensure_index missing from the essential list
00:43 jberger_ joined #mojo
00:54 jzawodn joined #mojo
01:02 mire joined #mojo
01:30 * marty realizes he stored images as a reference with the MongoDB driver (which bypasses the utf8 check) and wonders if bson_bin generic type is somehow different
01:31 * marty wonders if mango treats references similar the the mongodb driver
01:32 sri yes, references are handled like in Mojo::JSON
01:32 sri for booleans
01:32 marty I'll try that.  ty
01:32 sri the utf8 stuff is only for strings
01:34 TitanOfOld joined #mojo
01:34 sri umm, i mean no above :)
01:35 marty ohhhh
01:35 sri scalar references are binary data in MongoDB, but booleans in Mango
01:36 marty hmmm.  I'm still trying to track down my issue.  Theortically I should just be able to slurp an image file, wrap it in bson_bin and save it to the db, right?
01:36 sri yes
01:36 marty then read it back out and viola, world peace.
01:36 marty buuuuttt.  :)  I'm still working on that.  :)
01:37 * marty takes a step back to track this one down.
01:55 sri found another bug in the official driver, drop_dups doesn't work
01:56 sri min/max for geo indexes is also unsupported
01:58 Miked joined #mojo
02:16 biz joined #mojo
02:17 asarch joined #mojo
03:03 xaka joined #mojo
03:14 marty I got it!  of course mango is working perfectly.  The issue was the way the perl module I use for resizing images (Imager) handled file input.  For some reason if I quote my bson_bin object, it all works. go figure.
03:14 marty whew!
03:18 sri :)
03:18 * sri just added $collection->ensure_index and $collection->drop
03:18 marty \o/
03:19 sri the tests for ensure_index are not good yet though, i just test unique and drop_dups
03:19 marty I'll enable it here and report any wirdness
03:19 marty weird even
03:20 sri but that concludes the essentials section for mongodb driver \o/
03:20 marty \o/
03:20 * marty hands sri a root beer
03:20 sri *slurp*
03:37 sri i would really appreciate a few more index test scenarios btw
03:37 sri if anyone wants to help
03:38 sri a geo test would be neat, so i can add min/max options
03:39 sri for the name option too
03:40 sri i suppose that would go well with $cursor->hint
03:42 sri oh, expireAfterSeconds seems very useful
03:43 sri hard to test though
03:45 sri or, maybe i should just pass index arguments verbatim
03:46 sri it's {dumpDups => bson_true} then
03:46 sri yea, that might make more sense
03:46 sri this stuff will change all the time
03:48 sri umm, dropDups
03:51 sri and you can do booleans with \1 :)
04:04 Skylos_ joined #mojo
04:15 rem_lex|pivo joined #mojo
04:21 rem_lex|pivo joined #mojo
05:14 rem_lex| joined #mojo
05:39 sri and a big feature, because it was fun to hack on :)
05:39 sri https://github.com/kraih/mango/commit/c​a32518c06068b8fdaa1c02a6c75c29d796bb223
05:46 Caelum anyone use the linkedin js api? I tried it, and it doesn't work
05:46 Caelum it seems like you have to do serverside oauth calls now
06:13 jwang joined #mojo
06:20 sri yay, my Makefile.PL hack works :) http://www.cpantesters.org/​distro/M/Mango.html#Mango-0.03
06:33 * tempire wonders if it makes sense to use monkey_patch instead of autoload for helpers
07:03 Vandal joined #mojo
07:09 Mike-PerlRecruiter_ joined #mojo
07:14 dod joined #mojo
07:15 inokenty joined #mojo
07:16 basic6 joined #mojo
07:19 jwang joined #mojo
07:22 jberger joined #mojo
07:24 jberger does sri sleep?
07:24 jberger now we find out
07:25 jberger https://gist.github.com/jberger/4744482
07:25 jberger thoughts?
07:32 hmepas joined #mojo
08:22 hesperaux is there a document explaining how to write mojolicious plugins correctly?
08:22 hesperaux i'm trying to modify Mojolicious::Plugin::Databases and it broke severely. Can't figure out why
08:39 marty_ joined #mojo
09:17 komodo joined #mojo
09:24 BeDa joined #mojo
09:37 d4rkie joined #mojo
09:39 bjoernfan hesperaux: http://mojolicio.us/perldoc​/Mojolicious/Plugin/Config says "The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.", maybe look into that?
09:59 KindOne joined #mojo
10:57 ObseLeTe joined #mojo
11:25 ObseLeTe joined #mojo
11:40 ObseLeTe joined #mojo
11:56 GabrielVieira joined #mojo
11:58 dvinciguerra joined #mojo
12:14 ObseLeTe joined #mojo
12:17 kitt_vl joined #mojo
12:37 vishwanathms joined #mojo
12:45 ObseLeTe joined #mojo
12:57 mire joined #mojo
13:08 ObseLeTe joined #mojo
13:35 jberger sri: also, I think you have a doc bug in M::T::WebSocket
13:35 jberger https://metacpan.org/source/SRI/Mojolicious-​3.84/lib/Mojo/Transaction/WebSocket.pm#L428
13:35 jberger github is down right now
13:35 jberger for maint
13:35 jberger otherwise I would send a pull req
13:41 vervain jberger: Now who doesn't sleep? ;-)
13:49 Britzel_ joined #mojo
14:03 jpn joined #mojo
14:24 marty_ o/
14:36 vishwanathms joined #mojo
14:47 good_news_everyone joined #mojo
14:47 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/W8Go7w
14:47 good_news_everyone mojo/master a7d47f9 Sebastian Riedel: fixed typo in Mojo::Transaction::WebSocket
14:47 good_news_everyone left #mojo
14:48 vishwanathms joined #mojo
15:00 marty sri++ tailable cursors.  that's awesome
15:00 sri \o/
15:00 sri it's really great for pubsub with a non-blocking client
15:01 al802 joined #mojo
15:01 * marty nods
15:01 marty Lots of really fun things to do with that
15:02 sri btw. with the changed ensure index we also support TTL collections (where documents expire and get automatically deleted)
15:04 marty sweet.  That's quite a toolbox
15:04 al802 Guys, How do I use logging from hypnotoad
15:04 al802 I'm getting Can't locate object method "log" via package
15:05 al802 when I do $self->log->info("Hello World");
15:05 sri tempire: nope doesn't make sense, would break controllers
15:05 marty al802:  Does a directly 'log" exists under your app directory?
15:05 sri jberger: sometimes!
15:05 al802 yes/no
15:05 al802 depending
15:05 al802 so I usually don't have one
15:05 al802 so the output is sent to the console
15:06 sri al802: what is $self?
15:06 al802 app
15:06 sri then the log method exists
15:06 sri or rather... would exist
15:07 marty al802: $self->app->log->debug($self->dumper('foo'));
15:09 al802 :( not working
15:10 al802 is log available from within startup
15:11 al802 is there any documetation on using logging via hypnotoad
15:11 marty al802: $self->log->debug('foo');
15:12 sri there is nothing special about logging with hypnotoad, your app seems to be broken
15:21 Miked joined #mojo
15:21 al802 ok it works from within startup
15:21 al802 but no may app which is a different package
15:22 al802 so I call $self->MyApp::Utils::RestartServer($restart)
15:22 al802 and utils contains: my ($self,$signal) = @_;
15:23 al802 $self->log->debug('foo2');
15:23 al802 gets the error
15:24 lammel2 joined #mojo
15:27 jberger sri: sometimes?
15:29 vishwanathms joined #mojo
15:37 holger joined #mojo
15:39 al802 would I need to use Mojo::Base 'Mojolicious'; in MyApp::Utils ?
15:40 mattastrophe joined #mojo
15:46 sri jberger: i sleep sometimes
16:06 al802 sri: It's working now :) - and you were right as always. broken app
16:08 Britzel joined #mojo
16:16 * jberger really thought sri was a vampire
16:16 * jberger thinks vampires might pretend to sleep to hide the truth
16:42 Britzel left #mojo
16:44 sri :-E
16:44 Britzel joined #mojo
16:44 sri neat, find_and_modify is an atomic operation, that will come in handy for many tasks
16:53 * marty wonders if there is a downside to storing a mongo ObjectId inside a mojo cookie.  Or if it's just better to store the sting.
16:53 marty s/mongo/mango
16:54 marty I was just messing with a find and modify statement. lol
16:55 sri i'll add a $collection->find_and_modify later
16:55 marty \o/
16:56 sri it's just a command though, you can already use it :)
16:57 marty I've been using the commands quite a bit.  pretty painless.  I see you added some new methods like $collection->drop;
16:58 marty nice
16:58 sri ye, and $collection->create (for capped collections)
16:58 sri which are your most used commands?
17:00 marty for testing of course ->drop, ->create but for production is mostly the CRUD commands
17:00 * sri suspects find_and_modify and aggregate are the most important that deserve their own method
17:00 sri CRUD are not commands ;p
17:01 marty since find_and_modify return the document it's pretty handy.
17:01 sri insert, update, remove are actually special messages in the wire protocol
17:01 marty hehe ya, CRUD was a shortcut for find, find_one, insert, update, remove
17:02 sri when i say command, i mean $db->command(...)
17:02 sri commands are basically a special find_one on a collection named $cmd
17:03 human39 joined #mojo
17:04 marty ohhhh.   sorry, I'm lost.  doh!    commands I use are ensure_index.  an occasional distinct and prolly in the future map_reduce
17:04 sri hehe, ensure_index is an insert, not a command ;p
17:05 marty my needs are fairly limited at this point.  as you can tell. :)
17:05 * sri has not seen distinct yet
17:06 sri but yea, those little details shouldn't really matter for you :)
17:06 dod joined #mojo
17:06 sri i would just like to know your most common uses for $db->command(...), so i can put it on the shortlist for new methods ;)
17:06 al802 Is there a wa to include the caller IP address in the standard logging process
17:07 Skylos_ joined #mojo
17:07 marty most common for sure if find_and_modify.    I use distinct only once and not sure if I'll need it right away.
17:08 * marty is looking up mongoDB commands so make sure he does not forget any.  :)
17:09 marty ahhh, count is a command?  If so, I use that a lot
17:10 sri it is, but we have $collection->count already ;)
17:11 sri umm
17:11 sri $cursor->count
17:11 marty yep, just confirming that I like it.  :)
17:11 sri ah, ok
17:11 Skylos_ joined #mojo
17:12 sri btw. ->count currently uses skip and limit, we have no version without that
17:13 marty ok.  No problem.
17:13 * sri is not sure if we need one
17:13 marty is'nt that the way the old driver worked?
17:13 sri ->count_all is still on the table
17:14 * marty loves calling the MongoDB driver "old"  :)
17:14 sri i'm not sure, the old one is confusing
17:15 sri in fact, the old one is basically broken, since it uses limit like batch_size
17:16 marty so $mango->find({foo => 'bar'})->skip(5)->limit(5)->count_all;   would return all documents in the collection ignoring skip and limit?
17:16 sri yes
17:17 Skylos_ that's kinda cool.
17:17 marty that would be a very usefull feature if you decide to to do it
17:17 marty I didn't even think such a thing would be possible.
17:18 Skylos must be query metadata independent from the actual record set
17:19 Skylos but it does mean the server must converge the size of the recordset before/while responding to a limited request.
17:19 marty Hmm, dunno.  my $foo = $mango->find({foo => 'bar'})->skip(5)->limit(5)->count_all;  What would $foo contain?   an object?
17:19 sri count is independent of the cursor
17:19 Skylos which is interesting.  I'm sure some databases don't even bother enumerating all the possibles as an optimization for limited returns.
17:19 sri we just prepare the query and send it as a command
17:19 sri instead of a real query/get_more chain
17:20 Skylos if you're doing a table scan... limit 5... once you find 5 you can shortcut abort, who cares if there are 5 million more records that will match or not?
17:20 sri marty: a number
17:21 Skylos though if there's a sort in there the db WILL know.  So its only in certain use cases I suppose.
17:21 sri in fact, it's equivalent to doing my $foo = $mango->find({foo => 'bar'})->count;
17:21 sri both cost the same
17:21 sri you could just have two cursor objects as well
17:23 Skylos you're speaking of https://npmjs.org/package/mango I assume?
17:23 sri https://github.com/kraih/mango/bl​ob/master/lib/Mango/Cursor.pm#L51
17:23 sri it's really simple
17:23 sri Skylos: no
17:24 * sri is writing a better mongodb client for perl
17:24 Skylos Oh, okay.
17:24 Skylos that might come in handy.
17:25 marty has already come in very handy for me  :)
17:25 Skylos non-blocking perl.  Interesting.
17:26 Skylos is there somebody written a non-blocking loop style perl module?
17:26 Skylos with events and ticks?
17:26 sri dozens
17:26 Skylos you'd have to wrap obsessively to use it though.
17:26 sri mojolicious is an event loop at it's core
17:27 Skylos I thought I'd seen that in the mojo core when I was browsing the other day
17:27 Skylos that there were events being thrown and called.
17:27 Skylos I just considering all the things in perl that are blocking - you'd have to remap how you use them to be non-blocking.
17:28 sri blocking, non-blocking, functional, object oriented, mixing things up is perl-ish
17:28 Skylos yeah.  :D
17:29 * marty voted for     https://jira.mongodb.org/browse/SERVER-1594
17:30 al802 When you stop hypnotoad gracefully with --stop, it still calls the startup process, is this correct, is this part of a clean up, and if so, how can I detect it?
17:31 sri marty++
17:31 ObseLeTe joined #mojo
17:32 ObseLeTe joined #mojo
17:32 vervain joined #mojo
17:41 dod joined #mojo
17:45 tempire sri: how would it break controllers?
17:45 sri tempire: because helpers would suddenly answer to $controller->can(...)
17:46 sri every helper would become an action
17:46 tempire trolling helpers
18:07 sri oh noes, i forgot to check command results for errors
18:08 sri time to add $db->collection_names too
18:12 sri marty: the next commit might make a few things fail for you, since exception handling starts working ;p
18:13 marty ok, sri:  thanks for the heads up.  It's all good.
18:15 d4rkie joined #mojo
18:17 sri marty: and committed
18:17 marty \o/
18:17 sri ->create and ->drop actually complain when they have nothing to do :o
18:18 rem_lex|pivo joined #mojo
18:20 vervain joined #mojo
18:51 karel9 joined #mojo
18:59 karel9 For those of you who are interested in MITM HTTP(s) proxy based on Mojo's ioloop check my repo https://github.com/DCIT/mojo-mitm
19:00 karel9 It is far from full featured MITM proxy and there is a big chance it will break after significant changes in Mojo guts; however hacking on Mojo was fun.
19:00 karel9 Althougn it runs in single process its throughput is impressive (mojo++)
19:08 Mike-PerlRecruiter_ joined #mojo
19:14 sri karel9: interesting!
19:16 sri karel9: i expected much worse when you said there was big chance it would break when mojo internals change :)
19:18 karel9 sri: :) in fact based the main proxy module on your Mojo::Server::Daemon
19:18 * sri noticed
19:19 sri i guess a few things like steal_handle and the like a little risky (since there might be quite a few untested side effects that can easily break)
19:19 xxtjaxx sri: I know that you demonstrated "asset pipelining" before. But is there a Mojolicious::Command that allows you to minify static files under public/ ?
19:19 sri but in general it seems rather sane, you're not poking into internals as far as i can see
19:19 sri xxtjaxx: no
19:20 xxtjaxx sri: okay. Thanks
19:20 sri *+are
19:24 sri karel9: oh, you do server side SNI
19:24 karel9 sri: yes
19:25 karel9 but I use it only in one of my plugin I have not uploaded to github
19:25 karel9 as it is too close to some kind of phishing proxy
19:26 gryphon joined #mojo
19:27 karel9 but server side SNI in my proxy is a hack
19:28 sri yea, i imagine it would be cleaner if IO::Socket::SSL supported it
19:28 karel9 sri: btw server side SNI was recently added to IO::Socket::SSL
19:28 sri but interesting to see nonetheless
19:28 sri ah, i missed that :)
19:28 karel9 unfortunately they did not accept my original patch supporting callbacks
19:29 karel9 sri: you simply pass hashref to SSL_cert_file=>..
19:29 karel9 + also SSL_key_file=>..
19:29 sri oh, added last week :)
19:31 sri not a bad solution for most use cases i guess
19:31 sri of course for mitm you want callbacks
19:35 sri almost trivial to add support for SNI to Mojo::Server::Daemon... we just need to come up with a way to put those pairs into the listen string
19:36 sri possibly ?key:mojolicio.us=/etc/foo.key&.... or so
19:37 sri unit tests for it will be the hardest part
19:38 sri perhaps we can preconnect a socket, and do something like $tx->connection($socket)
19:39 sri mhm...that might do the trick :)
20:14 bluescreen joined #mojo
20:51 vervain joined #mojo
20:52 xaka joined #mojo
20:56 sri $collection->find_and_modify and $collection->aggregate are now working
21:07 biz joined #mojo
21:09 sri coming up with test cases for stuff like aggregation is way harder than the actual api https://github.com/kraih/mango/commit/0382​e6b5c21ec8b1ceabc3a73af1a7b52488ee90#L2R81
21:10 jberger sri: did you happen to look at my upload code before
21:10 jberger I have made several improvements and I wonder if you could give some feedback
21:10 sri jberger: only briefly
21:11 sri wrong mindset right now
21:11 jberger I understand
21:11 sri but i think it looked fine
21:12 jberger is there an easy way to tell the controller to use a subclass of Mojo::Transaction::WebSocket
21:12 jberger as of right now, I'm just reblessing
21:12 jberger but it might be more cute if there is a better way?
21:12 sri that sounds not so fine
21:12 jberger on upgrade?
21:14 jberger I think there is benefit for marty in this
21:15 jberger non-blocking websocket file uploads?
21:15 jberger marty is putting files into mango right? how did they get there?
21:15 jberger :[)
21:16 jberger actually my motivation is the last missing piece of Galileo
21:17 jberger but I understand if mango needs the attention now
21:17 jberger needs/has
21:22 Averna joined #mojo
21:26 marty sri++ on $collection->find_and_modify and $collection->aggregate
21:26 * marty will test
21:26 marty jberger: Yes, I'm loading images into mongodb via mango.   can I help in any way?
21:27 jberger no, not really
21:27 jberger other than wondering if this may help you
21:27 zivester joined #mojo
21:27 jberger these files, do they come into your app from the web?
21:27 jberger might it be useful to have non-blocking file uploads?
21:28 jberger it will be for Galileo, so I'm working on it anyway :-)
21:28 marty Not right now.  I'm uploading them from files on my computer
21:28 marty not so much in my case.  I
21:28 marty I'm low volume on the file uploads stuff
21:29 jberger it would be low-volume on my end too, but a user may want to upload several in one shot
21:29 * marty nods
21:29 marty It certainly would not hurt.  :)
21:29 * jberger continues
21:36 sri jberger: why would you want to change the transaction class?
21:36 jberger I'm just adding a method
21:36 sri why?
21:36 jberger it rearranges the event handlers
21:36 sri but why has it to be at the rather low transaction layer?
21:36 jberger I need to control the on frame handler
21:37 jberger because I stream the data into a Mojo::Asset
21:37 * sri doesn't follow
21:37 jberger and the data might be too big
21:37 sri you can hijack the frame event from the outside
21:38 jberger that is essentially what I'm doing, I'm just hiding it
21:38 sri hide it in a helper
21:38 sri make it a plugin
21:39 jberger yeah, that might work
21:39 jberger hmmmmmmm
21:39 sri replacing transaction objects is something i really don't like
21:40 Skylos joined #mojo
21:40 sri it has no future
21:40 sri that layer is gonna get seriously redesigned for http/2
21:41 sri so better stay as high level as you can
21:41 jberger noted
21:41 jberger can I call a helper on a transaction object?
21:41 sri on the controller instance
21:41 jberger or more specifically can I call one on the first argument of an "on message" handler?
21:41 jberger or would that then have to be a closure?
21:42 jberger over the controller
21:42 sri register the event with Mojolicious::Controller->on
21:42 sri only reason to go lower level would be to unsubscribe the default frame event
21:42 sri otherwise i think you can stay on the controller layer
21:42 jberger well I have to do that
21:43 jberger ok
21:43 jberger I will try to think about it in those terms
21:43 sri $c->on(frame => sub {...}) works just fine
21:44 sri pretty sure i have a test case too
21:44 sri https://github.com/kraih/mojo/blob/maste​r/t/mojolicious/websocket_lite_app.t#L59
21:44 sri there you go
21:44 jberger see, the method tells the websocket transaction that the next message will be a file
21:44 jberger then at the finish it restores the previous state
21:45 * jberger looks
21:45 sri yea, that's maybe 2-3 method calls on the transaction object, everything else is higher level
21:46 jberger k
21:46 * jberger tries to think higher
21:46 * jberger wonders where the fritos are
21:47 * Skylos offers some spicy scoops
21:47 sri my $subscribers = $self->tx->subscribers('frame'); $self->tx->unsubscribe('frame'); ... do your thing...; $self->tx->on(frame => $_) for @$subscribers;
21:48 sri easy to hide in a helper
21:49 sri $self->websocket_asset_pipeline(sub { my ($self, $asset) = @_; });
21:49 sri :)
21:51 sri actually, you could be even smarter
21:51 sri not sure if i should give you evil ideas ;p
21:52 sri but you could intercept the default frame event with your own frame event, scan frames and look for an upload trigger, then reroute only the frames for your uploads ;p
21:53 sri that stuff works better on a higher level though, when you establish your own protocol mapped on top of websockets
21:54 sri websockets are a very low level transport protocol, don't be afraid to put your own protocol on top
21:56 sri surely you could use JSON messages, then just split up your file manually into chunks in JavaScript, base64 encode, and send chunks as full websocket messages
21:57 Skylos left #mojo
21:58 sri messing with individual frames kinda sucks, and you can only do it in perl, javascript has no frame level api AFAIK
22:00 sri hmmm... perhaps i've made frames too accessible
22:04 jberger I dare say, I think it works better as a helper!
22:04 jberger https://gist.github.com/jberger/4744482
22:05 sri \o/
22:05 jberger o/
22:05 jberger see rather than try to intercept just part of the data as a file
22:05 jberger for now I think its just easier to send any file metadata, name size etc
22:06 jberger then tell the transaction to await the file
22:06 sri next_message_is_file makes perfect sense yea
22:06 jberger I believe that when you send a file the DOM File API chunks it for you, so I'm not going to fiddle with that
22:07 jberger some of this is based on binary.js
22:07 jberger but I couldn't separate it from the node.js stuff
22:07 jberger it assumes your server-side is node and I couldn't figure out how to avoid that
22:08 * vervain loves watching jberger do his R&D for him. :-)
22:08 * jberger bows
22:08 vervain You go dude. :-)
22:08 * jberger goes to test on some very large file
22:09 sri oh, your $ws is wrong in the gist
22:09 vervain My clients are potentially going to want to batch upload several hundred files at time 8-|
22:09 sri should be $self
22:09 sri $self->next_frame_is_file
22:10 * jberger looks
22:10 jberger it worked?
22:11 marty \o/ yay for jberger
22:11 jberger large file crashed chrome
22:11 jberger hmmmmm
22:12 sri :)
22:12 jberger I just the autochunking didn't happen
22:12 sri i wouldn't be surprised if browsers were still rather stupid about chunking large messages
22:13 jberger its probably not a big deal right now
22:13 jberger of course I'm going to look into it
22:13 jberger but my use-case is image upload
22:16 * jberger tries to find chunkin documentation that doesn't involve punkins
22:20 jberger it seems that the chunking was a feature of binary.js
22:20 jberger I guess I have to decide if the logic is worth porting
22:21 jberger at this point I can stream any file that your browser can load into memory I guess
22:23 ObseLeTe joined #mojo
22:24 vervain The only kind of chunkin is the punkin kind!!!
22:26 sri hmmmmm... looking through the official mongodb driver, we are almost equal feature wise now
22:27 jberger vervain, :-) I'm glad someone liked it
22:27 sri Mango has a few MongoDB doesn't have and vice versa
22:45 * marty chants mango mango mango
22:45 * marty thinks today feels like a mini hackathon
22:50 jberger it kinda does
22:51 jberger https://developer.mozilla.org/en-US/d​ocs/Using_files_from_web_applications
22:52 * sri is still not sure how to do GridFS
22:57 jberger don't you hate it when you search for an hour for a good example, and when you find it you notice that its bookmarked!
22:59 jberger http://www.html5rocks.com/e​n/tutorials/file/dndfiles/
23:13 Miked joined #mojo
23:15 jberger I don't understand what frames are
23:15 jberger no matter how much I try to send it all seems to come in one frame
23:16 jberger in that case I should just leave the "on frame" handler alone and just chunk/reassmble elsewhere
23:16 jberger I guess I assumed ...
23:18 jberger http://stackoverflow.com/questions/130​10354/chunking-websocket-transmission
23:19 jberger maybe that makes things easier
23:19 maxhq joined #mojo
23:20 sri frames are basically an implementation detail
23:21 sri most APIs only expose messages and internally decide with how many frames to transmit a message
23:21 sri like i said before, websockets are very low level, you're supposed to build your own protocol on top
23:25 sri normal people don't mess with frames
23:54 jberger sri: I believe you now
23:54 jberger actually IIRC you said that after I had already done it, so TECHNICALLY I didn't ignore your warning
23:54 jberger :-)
23:55 jberger anyway, it means I can chuck most of it
23:58 * jberger is not a normal person :-P
23:59 marty yea being non-normal

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary