Show newer

I didn't think that was right, so I dug into it a bit more and realized Laravel was setting that stream_reads setting to false.

I dug a bit more and realized exactly what that TEMP resource actually did.

It's something from Guzzle, presumably done to stop you shooting your feet off: it writes the data to disk to stop you going OOM.

docs.guzzlephp.org/en/stable/p

Show thread

The behaviour I was seeing, despite using readStream(), was that for large files, I would get null instead of the resource.

If I examined the resource with stream_get_meta_data(), I saw it was a TEMP resource. The PHP docs don't really explain that much.

For a while, I assumed it was fine.

Then I ran it locally with a large file and my queue driver se to sync and noticed ... it took about 4 seconds to just read the file.

Show thread

The default in Flysystem's driver is true:

github.com/thephpleague/flysys

this threw me off a bit, since I was looking at the driver on S3 and assumed the defaults.

And I was getting *a* resource, just not one that behaved in the way I assumed it would.

Show thread

One more gotcha in when working with S3.

Storage has a readStream() method, which returns a stream resource instead of trying to jam a heckin' 2GB zip into memory.

The method will always return a resource -- but out of the box, it won't be a resource to stream from S3.

For whatever reason, Laravel defaults the setting stream_reads to false:

github.com/laravel/framework/b

Copying a big heckin' 2GB zip file around in S3 can potentially take a couple seconds.

I was hitting my Lambda's 10-second timeout as a result!

Show thread

Got burned by the Storage interface today.

I'm using an S3 filesystem. After a user uploaded a (potentially large) file to S3 and their form request is validated/saved, I was moving the file from a `tmp/` spot in S3 to a permanent spot.

This was done using ->move(), which I assumed would be an instantaneous rename operation.

Not so. S3 doesn't seem to *have* a move operation -- only copy -- and Flysystem uses that plus delete for "moving" objects.

An incredible ending to the first story arc.

I'm so glad for the wheelbarrow community.

Show thread

spoilers for Sturdy Wheelbarrow podcast 

"Silence kills in the wheelbarrow industry."

Show thread

ended up getting this mostly done on Friday!

It needs some polish but there's time enough for that on Monday, probably.

SO INSTEAD I WILL WRITE SOME USER GUIDES BECAUSE I HATE FUN

Show thread

Another loud noise and a whole horde of zombies are now coming at us.

We're retreating towards a cottage on the hilltop made of stone (so nobody can ever burn it down).

Ignoring the fact that it keeps emitting towering pillars of blinding light.

Beggars can't be choosers!

Show thread

we've gotten a bit off track while slaying the zombies

and have determined that, canonically, Aluminum got its name because the first human to dig out of the ground just read the name off the tooltip for the item

Show thread

Sorc: I can't charm a zombie -or- a skeleton, right?

DM: right

Sorc: *sigh*

Show thread

Cleric: I cast Sacred Flame at the zombie

DM: this zombie crit its save, so it dodges like it's the fucking matrix

DM: Ayeron, your turn

Me: i'll throw some tentacles at the thriller zombie

Show thread

Bard: I can see them all as if they are Robert Normalman. Do they look like Robert Normalman to me?

DM: no, none of them resemble him

Bard: how do I know? I've never seen Robert Normalman.

DM:

Bard: They do look normal.

DM: Some look Standard too.

Druid: ⁉️

Show thread

Bard: are zombies wise?

DM: you can roll religion if you want to gauge the-

*Bard rolls nat 20*

DM: ok you know all their modifiers.

Show thread

Sorc: ok *fine* i'll fire a chaos bolt instead

Show thread

We had heard about this in the newspaper before we left to find the Grey Dogs!

Show thread
Show older
YSHI

Syndicate is Strong