Initial commit
This commit is contained in:
16
file_generator
Executable file
16
file_generator
Executable 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);
|
||||
}
|
||||
Reference in New Issue
Block a user