Skip to content

Conversation

@mcfnord
Copy link
Contributor

@mcfnord mcfnord commented Jul 9, 2023

Discussed in #3089

docs/JSON-RPC.md Outdated
- A **response** from Jamulus to the consumer.
- A **notification** from Jamulus to the consumer.

**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool.
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be worth add "for scripting and dianostic purposes" - as, more general use, these tools probably aren't what you'd be using. You'd probably be writing a program.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added a link to a Node.js snippet.

Copy link
Member

@ann0see ann0see left a comment

Choose a reason for hiding this comment

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

I'd be ok with it in this state too. But please still consider pljones' comment.

@ann0see ann0see changed the title tip for connecting to JSON-RPC endpoint Add tip for connecting to JSON-RPC endpoint Jul 9, 2023
@ann0see
Copy link
Member

ann0see commented Jul 10, 2023

Also I'm not sure if this file gets overwritten by some Python script if new methods are added.

See https://github.com/jamulussoftware/jamulus/blob/main/tools/generate_json_rpc_docs.py

@mcfnord
Copy link
Contributor Author

mcfnord commented Jul 10, 2023

Thanks for noticing that. So I should instead modify that script, and then run it to generate the new md file? And those two files are the new commit? This appears to be the pattern.

@badstorm77
Copy link

Jamulus server Qjack ctrl

It would be wonderful to be able to realise this ...

@ann0see
Copy link
Member

ann0see commented Jul 10, 2023

docs/JSON-RPC.md Outdated
- A **response** from Jamulus to the consumer.
- A **notification** from Jamulus to the consumer.

**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. Also [see this page](https://github.com/jamulussoftware/jamulus/pull/1975) for a connection example using Node.js.
Copy link
Collaborator

@pljones pljones Jul 10, 2023

Choose a reason for hiding this comment

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

I think something simpler for the reader than a reference to a pull request is needed. Extracting the example into a gist might be better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Extracting the example into a gist might be clearer.

Have we published documentation snippets to gist before? I can make one in my account, but that's not making one in this repo.

Copy link
Member

Choose a reason for hiding this comment

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

What speaks against including it into this document?

Copy link
Collaborator

Choose a reason for hiding this comment

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

What speaks against including it into this document?

I wasn't sure (as I couldn't find it) how big it was.


**Tip:** On Linux, you can connect to a JSON-RPC server using the `nc` CLI tool. On Windows, you can download and use the `ncat` CLI tool. This snippet uses [jayson](https://www.npmjs.com/package/jayson) to connect using Node.js:


Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
<pre>const jayson = require("jayson/promise");
const client = new jayson.client.tcp({ host: "127.0.0.1", port: 22100 });
client.request('jamulusserver/getServerInfo', {})
.then(console.log)
.catch(console.error)</pre>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps I've reached a limit in the suggestion interface, by trying to show code there.

In any case, this doesn't go here anyway. It gets dropped into the script source. But how do I designate the code? With pre or code tags?

Copy link
Member

@ann0see ann0see Jul 10, 2023

Choose a reason for hiding this comment

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

None of both. You'll need to use three backticks: ` in markdown.

@mcfnord mcfnord marked this pull request as draft July 10, 2023 18:58
@ann0see ann0see closed this Jul 11, 2023
@ann0see
Copy link
Member

ann0see commented Jul 11, 2023

Closed as you've opened a new PR

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants