-
Notifications
You must be signed in to change notification settings - Fork 345
Update kxrpc tutorial to 0.10.0 #695
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,7 +219,7 @@ | |
and add the following implementation: | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="1-13,14-37,39-40,59-60" | ||
include-lines="1-14,15-38,40-41,60-61" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chainVerify that the updated line ranges correctly reflect the Client.kt changes. Multiple Run the following script to verify the line ranges: Also applies to: 242-242, 254-254, 263-263, 279-279, 291-291, 497-497, 505-505 🏁 Script executed: #!/bin/bash
# Extract and display the specified line ranges from Client.kt
echo "=== Lines 1-14 (imports section) ==="
sed -n '1,14p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
echo -e "\n=== Lines 15-38 (main function setup) ==="
sed -n '15,38p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
echo -e "\n=== Lines 40-41 (commented pizza order) ==="
sed -n '40,41p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
echo -e "\n=== Line 60 (client close) ==="
sed -n '60p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
echo -e "\n=== Lines 43-50 (multiple orders) ==="
sed -n '43,50p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt
echo -e "\n=== Lines 52-58 (collect results) ==="
sed -n '52,58p' codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt Length of output: 1817 🏁 Script executed: #!/bin/bash
topic="topics/tutorial-first-steps-with-kotlin-rpc.topic"
client="codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt"
# 1. Confirm closing brace at line 61
echo "=== Lines 59-62 (closing brace check) ==="
sed -n '59,62p' "$client"
# 2. For each updated include-lines (topic lines 222,242,254,263,279,291,497,505), extract and display code segments
grep -n 'include-lines="' "$topic" | grep -E ':(222|242|254|263|279|291|497|505):' | while IFS=: read path line attr; do
ranges=$(echo "$attr" | sed -E 's/.*include-lines="([^"]+)".*/\1/')
echo -e "\n=== topic:$line → include-lines=\"$ranges\" ==="
IFS=, read -ra parts <<< "$ranges"
for r in "${parts[@]}"; do
echo "--- Client.kt lines $r ---"
sed -n "${r}p" "$client"
done
done Length of output: 67 🏁 Script executed: #!/bin/bash
grep -n 'include-lines=' topics/tutorial-first-steps-with-kotlin-rpc.topic Length of output: 1035 🏁 Script executed: #!/bin/bash
client="codeSnippets/snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt"
echo "=== Lines 17-21 ==="
sed -n '17,21p' "$client"
echo -e "\n=== Lines 23-35 ==="
sed -n '23,35p' "$client"
echo -e "\n=== Line 37 ==="
sed -n '37p' "$client"
echo -e "\n=== Lines 40-41 ==="
sed -n '40,41p' "$client"
echo -e "\n=== Lines 43-50 ==="
sed -n '43,50p' "$client"
echo -e "\n=== Lines 52-58 ==="
sed -n '52,58p' "$client"
echo -e "\n=== Line 60 ==="
sed -n '60p' "$client" Length of output: 1207 🏁 Script executed: #!/bin/bash
sed -n '230,260p' topics/tutorial-first-steps-with-kotlin-rpc.topic Length of output: 1874 Update runBlocking snippet range 🤖 Prompt for AI Agents
|
||
/> | ||
</step> | ||
</procedure> | ||
|
@@ -239,7 +239,7 @@ | |
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="15,60" | ||
include-lines="16,61" | ||
/> | ||
<tip> | ||
Note that <code>runBlocking</code> is designed for spikes and tests, rather than production code. | ||
|
@@ -251,7 +251,7 @@ | |
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="16-20" | ||
include-lines="17-21" | ||
/> | ||
<p> | ||
Having created this Ktor client, you then create a <code>KtorRpcClient</code> object for invoking remote | ||
|
@@ -260,7 +260,7 @@ | |
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="22-34" | ||
include-lines="23-35" | ||
/> | ||
<p> | ||
At this point, the standard setup has been completed, and you are ready to use the functionality | ||
|
@@ -276,7 +276,7 @@ | |
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="39-40" | ||
include-lines="40-41" | ||
/> | ||
<p> | ||
Note that a tremendous amount of work is being done for you at this point. The details of the call and | ||
|
@@ -288,7 +288,7 @@ | |
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="59" | ||
include-lines="60" | ||
/> | ||
</chapter> | ||
<chapter title="Implement the server" id="server-implementation"> | ||
|
@@ -494,15 +494,15 @@ | |
file, submit multiple orders using two different client IDs: | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="36,42-49" | ||
include-lines="37,43-50" | ||
/> | ||
<p> | ||
Then you iterate over the results, using the <code>Coroutines</code> library and | ||
<code>collect</code> method: | ||
</p> | ||
<code-block lang="kotlin" | ||
src="snippets/tutorial-kotlin-rpc-app/src/main/kotlin/Client.kt" | ||
include-lines="51-57" | ||
include-lines="52-58" | ||
/> | ||
</step> | ||
<step> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify plugin versions exist and check for security advisories.
The plugin versions have been updated to:
Ensure these versions are valid and check for any associated security advisories.
Run the following script to verify the versions:
🏁 Script executed:
Length of output: 262
Fix invalid Ktor plugin version:
id("io.ktor.plugin") version "3.3.0"
is not published on Maven Central. Update to a valid release (see https://repo1.maven.org/maven2/io/ktor/ktor-gradle-plugin/).🤖 Prompt for AI Agents