Created
February 17, 2020 09:49
-
-
Save davor010/41ddf289c4155bce8daa8960d4cf885b to your computer and use it in GitHub Desktop.
using transformer in between (mysql, clickhouse)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$promise = new React\Promise\FulfilledPromise(1); | |
$transformer = new Transformer(1, function ($data) use ($promise){ | |
return $promise->then( | |
function () use ($data) { | |
return array('id' => $data['id'], 'stocknummer' => $data['id'], 'dealer_id' => $data['id'], '_vnr' => 1, '_checksum' => sha1(json_encode($data)), '_timestamp' => date('Y-m-d h:i:s')); | |
} | |
); | |
}); | |
//try to change in Client class add _vnr, _checksum and _timestamp | |
$source->pipe($transformer)->pipe($stream); | |
//$source->pipe($stream); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment