Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Method of programmatically determining when values have been persisted back to Neo4J #37

Open
gitsome opened this issue May 2, 2015 · 2 comments
Assignees

Comments

@gitsome
Copy link

gitsome commented May 2, 2015

I am using NodeJS to trigger the pagerank algorithm. I understand once I end up with a ton of nodes and edges that it could take some time, but I wanted to have an automated way of determining when that process is complete so I can start additional logic that depends on the Neo4J nodes being updated with the values calculated by Mazerunner.

You had mentioned that I could check the log file. I think I can make that work using Node, to simply tail that file and scan the output.

Is there another way? Perhaps the original http call to trigger the job could return a jobId and then I can poll another http endpoint with that jobId for status/progress? I'm probably misusing the project anyway :-), but figured I would ask.

Here is my code:

http.get(CONF.neo4J.paths.pageRank, function(response) {

            var body = '';

            response.on('data', function(d) {
                body += d;
            });

            response.on('end', function() {

                var parsed = JSON.parse(body);
                if(parsed.result && parsed.result === "success") {

                    jobTaskInstance.complete({success:'awesome'});

                } else {

                    jobTaskInstance.error('Unknown error running PageRank');
                }
            });

        }).on('error', function(e) {
            jobTaskInstance.error(e.message);
        });

So maybe the response body could look like?

{"result":"success", "jobId":1234}

Love this project!!!

@kbastani
Copy link
Member

Hi @gitsome, thanks for the issue. Sorry it's taken this long to get back to you on this thread. I think it makes sense to do a resource-based REST API that allows you to do simple job management. Thanks for putting that example together, it makes a lot of sense.

I've been putting off job management because there are so many great tools out there that do things like job management and scheduling.

I guess the question for me at this point is whether or not a job scheduler should be the responsibility of a new microservice that Neo4j integrates with or if it should be a part of the Mazerunner extension. That leads to another question which is whether or not Mazerunner should become a platform or continue to be maintained as a simple tool dedicated to solving a well defined problem.

Open source is hard. :)

Should we make this thing a full framework and potentially a cloud-native platform, or should we keep it a simple tool?

@kbastani kbastani self-assigned this Jul 30, 2015
@gitsome
Copy link
Author

gitsome commented Aug 16, 2015

No worries, thanks for taking a look at this. I have noticed you have been a busy man these days! Seems you are mixed up in some exciting things (all of which I'm trying to keep up with).

I wouldn't put too much emphasis on my opinions, I have mostly front-end experience, but from my perspective it seems this should continue to be a simple tool. That is how I am using it, however, I do need to know when this tool has completed it's task. So if I simply need to monitor logs, then no problem, perhaps just highlighting documentation on how to do that would be sufficient?

Regardless thanks again for this great work! Providing these types of tools really has enhanced my own projects!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants