Created
April 25, 2017 16:17
-
-
Save catarak/685cec167e73a2bb621dcec53b9c734f 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
// An example of one of our microservices - handles importing to Elasticsearch | |
class ESCollection extends UpdateEmitter { | |
get status() { | |
// should return a JSON object which is passed along with the websocket event | |
} | |
syncESWithCSV(csvName) { | |
this.started(); // emits 'started' event to any front-end listening for it | |
// do stuff to load CSV to Elasticsearch | |
this.progress(); // emits 'progress' event with the status | |
// do more stuff | |
this.completed; // emits 'completed' event | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment