Skip to content

Instantly share code, notes, and snippets.

@davor010
Created February 17, 2020 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save davor010/41ddf289c4155bce8daa8960d4cf885b to your computer and use it in GitHub Desktop.
Save davor010/41ddf289c4155bce8daa8960d4cf885b to your computer and use it in GitHub Desktop.
using transformer in between (mysql, clickhouse)
$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