-
Notifications
You must be signed in to change notification settings - Fork 62
Course definitions for Redis/Pub-Sub stages #329
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
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
@@ -3878,3 +3878,40 @@ stages: | |||
name: "Blocking retrieval with timeout" | |||
difficulty: medium | |||
marketing_md: In this stage, you will add support for a non-zero timeout duration for the `BLPOP` command. | |||
|
|||
# Pub-Sub | |||
- slug: "mx3" |
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.
We'll need to add the extension above to the extensions
key too btw
stage_descriptions/pubsub_1_mx3.md
Outdated
@@ -0,0 +1,51 @@ | |||
In this stage, you’ll add support for the `SUBSCRIBE` command. | |||
|
|||
### The `SUBSCRIBE` Command |
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.
Not really reviewing these, assuming they're the same as slab for now
|
course-definition.yml
Outdated
|
||
- slug: "lf1" | ||
primary_extension_slug: "pub-sub" | ||
name: "Change PING behavior" |
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.
name: "Change PING behavior" | |
name: "PING in subscribed mode" |
stage_descriptions/pubsub_3_aw8.md
Outdated
|
||
The tester will then send a series of commands, which might be allowed or un-allowed for subscribed mode. | ||
|
||
For un-allowed command (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error: |
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.
For un-allowed command (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error: | |
For un-allowed commands (like `SET`, `GET`, and `ECHO`) the tester will verify that your server responds with the following error: |
stage_descriptions/pubsub_3_aw8.md
Outdated
|
||
The tester only verifies that error message starts with "Can't execute '<command_name>'", so you're free to use a flexible error message and not stick to the exact format that Redis uses. | ||
|
||
For `SUBSCRIBE` command, the tester will verify that the response is its usual response. |
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.
For `SUBSCRIBE` command, the tester will verify that the response is its usual response. | |
For the `SUBSCRIBE` command, the tester will verify that the response is its usual response. |
stage_descriptions/pubsub_3_aw8.md
Outdated
- `Can't execute 'set' in subscribed mode` | ||
- `can't execute 'SET' when one or more subscriptions exist` | ||
|
||
- In this stage, you'll only need to handle responding with errors in case of `SET`, `GET`, and `ECHO` commands. We will get to modifying the response of `PING` command in Subscribed mode in the next stage. |
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.
We don't mention that PING has a different response at all, so this note could be confusing to users. Let's instead mention just that fact:
- In subscribed mode, `PING` has a different response (it doesn't respond with `+PONG\r\n`). We'll get to this in later stages.
stage_descriptions/pubsub_4_lf1.md
Outdated
@@ -0,0 +1,38 @@ | |||
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode. | |||
|
|||
### Subscribe Mode (Modification of `PING`) |
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.
### Subscribe Mode (Modification of `PING`) | |
### `PING` in subscribed mode |
stage_descriptions/pubsub_4_lf1.md
Outdated
@@ -0,0 +1,38 @@ | |||
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode. |
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.
In this stage, you'll add support for modifying the response of `PING` command in the subscribed mode. | |
In this stage, you'll add support for responding to `PING` when a client is in subscribed mode. |
stage_descriptions/pubsub_4_lf1.md
Outdated
|
||
### Subscribe Mode (Modification of `PING`) | ||
|
||
If a ping command is issued from a client after it enters the subscribed mode, the server does not respond with `+PONG\r\n`, which is the usual response of `PING` command. Instead, the response is a RESP-Array of two elements |
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.
If a ping command is issued from a client after it enters the subscribed mode, the server does not respond with `+PONG\r\n`, which is the usual response of `PING` command. Instead, the response is a RESP-Array of two elements | |
If a ping command is issued from a client after it enters subscribed mode, Redis does not respond with the usual response (`+PONG\r\n`). Instead it responds with a RESP array of two elements: |
stage_descriptions/pubsub_4_lf1.md
Outdated
pong\r\n | ||
$0\r\n | ||
\r\n | ||
``` |
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.
We should also test PING from a regular client after this to ensure the behaviour only changes for subscribed clients and not others.
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.
Added notes specifically for the subscribed mode & ping stage - good to go once those are addressed!
- Rename stage description files to comply with the new format
No description provided.