Skip to content

Conversation

@taooceros
Copy link
Member

@taooceros taooceros commented Feb 8, 2021

Question:

  1. why not use json serialize method in ToString method in JSONRPCModel.
  2. whether we want an async version of action?
  3. async version for context menu?

@taooceros taooceros added this to the 1.8.0 milestone Feb 10, 2021
@taooceros
Copy link
Member Author

taooceros commented Feb 14, 2021

Got a question.

if (result.StartsWith("DEBUG:"))
{
    MessageBox.Show(new Form {TopMost = true}, result.Substring(6));
    return string.Empty;
}

Does anyone actually use this to debug? This prevents making it based on Stream, because Stream are impossible to peek.

I think it will be better to parse it into another field in JsonRPCQueryResponseModel.

@taooceros taooceros marked this pull request as ready for review February 14, 2021 03:47
@jjw24
Copy link
Member

jjw24 commented Feb 14, 2021

Does this just show a message box when result starts with debug?

@taooceros
Copy link
Member Author

Does this just show a message box when result starts with debug?

Yes

@taooceros
Copy link
Member Author

It will prevent from assuming the returning message is based on JsonRPCQueryResponseModel so that we can't deserialize it based on stream.

@jjw24
Copy link
Member

jjw24 commented Feb 14, 2021

Yeah let's get rid of it. Surely there is a better implementation for debugging

@jjw24
Copy link
Member

jjw24 commented Feb 15, 2021

Ready for review?

@taooceros
Copy link
Member Author

Ah yes!

@jjw24
Copy link
Member

jjw24 commented Feb 15, 2021

The to dos in the PR description are no longer relevant right?

@taooceros
Copy link
Member Author

The to dos in the PR description are no longer relevant right?

Yeah they are questions, not quite relate to the change in this branch.

@jjw24
Copy link
Member

jjw24 commented Feb 15, 2021

Have we done any testing with this?

@jjw24
Copy link
Member

jjw24 commented Feb 15, 2021

The to dos in the PR description are no longer relevant right?

Yeah they are questions, not quite relate to the change in this branch.

Hmmm i havent played enough with non-c# plugins to be able to answer those. General rule of thumb, if it improves Flow and you have tested it to make sure, then lets PR it. Leaving those questions here I will likely forget, unless you will remember :)

@taooceros
Copy link
Member Author

Have we done any testing with this?

I check out that python plugin will work if python works. If It doesn't work, the error reporting part will be triggered (I think the EndofStream works).

public abstract string SupportedLanguage { get; set; }

protected abstract string ExecuteQuery(Query query);
protected abstract Task<Stream> ExecuteQueryAsync(Query query, CancellationToken token);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change backwards compatible?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSONRPCPlugin is in Flow, and what it is doing is that overriding the Query (or QueryAsync) to call the executable (or python) and communicate via console stream. So change here won't affect the compatibility of plugins.

}
}

public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)
Copy link
Member

@jjw24 jjw24 Feb 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change from Query to QueryAsync, will this be backwards compatible for plugins using JsonRPC?

@taooceros
Copy link
Member Author

Hmmm i havent played enough with non-c# plugins to be able to answer those. General rule of thumb, if it improves Flow and you have tested it to make sure, then lets PR it. Leaving those questions here I will likely forget, unless you will remember :)

Well actually these questions are also relate to c# plugins. What do you think about them?

@taooceros
Copy link
Member Author

taooceros commented Feb 16, 2021

The change in this branch are majorly using the IAsyncPlugin to allow early stop (not completely because I don't know whether we can stop the external program), and read Stream instead of reading string to reduce the cost of creating string based on Standard output stream.

@jjw24
Copy link
Member

jjw24 commented Feb 16, 2021

Hmmm i havent played enough with non-c# plugins to be able to answer those. General rule of thumb, if it improves Flow and you have tested it to make sure, then lets PR it. Leaving those questions here I will likely forget, unless you will remember :)

Well actually these questions are also relate to c# plugins. What do you think about them?

oh yeah you are right. I think why not, we can do it for QueryAsync implementation and test it, not that it's a necessity right now though, but implementing it may allow for future usage and expansion.

@jjw24 jjw24 enabled auto-merge February 16, 2021 02:45
@jjw24
Copy link
Member

jjw24 commented Feb 16, 2021

Let's create issues for the questions and can discuss or implement it.

@jjw24 jjw24 self-assigned this Feb 16, 2021
@jjw24 jjw24 added the enhancement New feature or request label Feb 16, 2021
@jjw24 jjw24 merged commit 6c42458 into Flow-Launcher:dev Feb 16, 2021
This was referenced Feb 16, 2021
@taooceros taooceros deleted the JSONRPCModelOpt branch February 25, 2021 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants