Initial commit

This commit is contained in:
Joop Schilder
2020-06-19 17:04:39 +02:00
commit 3b8438f9e7
7 changed files with 161 additions and 0 deletions

16
file_generator Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env php
<?php
$argc < 2 and die('Usage: file_generator <namespace>' . PHP_EOL);
require_once __DIR__ . '/vendor/autoload.php';
$push = (new ZMQContext)->getSocket(ZMQ::SOCKET_PUSH)->connect('ipc:///tmp/storage_server_sink.ipc');
$faker = Faker\Factory::create();
$id = 1;
while (true) {
$document = file_get_contents("https://twitter.com/{$faker->firstName}");
$push->send($argv[1], ZMQ::MODE_SNDMORE)
->send($id++ . '.html', ZMQ::MODE_SNDMORE)
->send($document);
sleep(2);
}