Last active
April 26, 2023 03:51
-
-
Save dewaldabrie/6193778740c968752ceedbef887ad84b to your computer and use it in GitHub Desktop.
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
from coroflow import Pipeline, Node | |
import logging | |
from .data_collector import agg_data_deserialise, get_symbols, agg_data_update, agg_data_serialize | |
def main_sync(): | |
# Create Pipeline with a node for each function passed in. | |
# Data flows like so: | |
# get_symbols -> symbol_data -> agg_data_update | |
p = Pipeline.simple_pipe([ | |
get_symbols, # Node 1 | |
symbol_data, # Node 2 | |
(agg_data_deserialise, agg_data_update, agg_data_serialise), # Node 3 with (setup, execute, teardown) functions | |
]) | |
# Run it! | |
p.run() | |
if __name__ == '__main__': | |
start_time = time.time() | |
main_sync() | |
duration = time.time() - start_time | |
print("Duration: {} seconds.".format(duration)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment