@@ -89,6 +89,18 @@ extensions:
89
89
[xadd-command]: https://redis.io/commands/xadd/
90
90
[xrange-command]: https://redis.io/commands/xrange/
91
91
92
+ - slug : " transactions"
93
+ name : " Transactions"
94
+ description_markdown : |-
95
+ In this challenge extension you'll add support for [Transactions][redis-transactions] to your Redis implementation.
96
+
97
+ Along the way, you'll learn about the [MULTI][multi-command], [EXEC][exec-command], and [DISCARD][discard-command] commands, as well as how Redis handles transactions atomically.
98
+
99
+ [redis-transactions]: https://redis.io/docs/latest/develop/interact/transactions/
100
+ [multi-command]: https://redis.io/commands/multi/
101
+ [exec-command]: https://redis.io/commands/exec/
102
+ [discard-command]: https://redis.io/commands/discard/
103
+
92
104
stages :
93
105
- slug : " jm1"
94
106
concept_slugs :
@@ -1803,6 +1815,7 @@ stages:
1803
1815
In this stage, you'll finish implementing the WAIT command on your master.
1804
1816
1805
1817
# Streams
1818
+
1806
1819
- slug : " cc3"
1807
1820
primary_extension_slug : " streams"
1808
1821
name : " The TYPE command"
@@ -3142,3 +3155,313 @@ stages:
3142
3155
- In the response, the items are separated onto new lines for readability. The tester expects all of these to be in one line.
3143
3156
marketing_md : |
3144
3157
In this stage, you'll add extend support to `XREAD` to allow for passing in `$` as the ID for a blocking command.
3158
+
3159
+ # Transactions
3160
+
3161
+ - slug : " si4"
3162
+ primary_extension_slug : " transactions"
3163
+ name : " INCR Command (1/3)"
3164
+ difficulty : easy
3165
+ description_md : |
3166
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3167
+
3168
+ ### Tests
3169
+
3170
+ The tester will execute your program as a master like this:
3171
+
3172
+ ```
3173
+ ./spawn_redis_server.sh
3174
+ ```
3175
+
3176
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3177
+
3178
+ ```bash
3179
+ $ redis-cli SET foo 41
3180
+ > INCR foo
3181
+ ```
3182
+
3183
+ marketing_md : |
3184
+ In this stage, you'll start implementing the INCR command.
3185
+
3186
+ - slug : " lz8"
3187
+ primary_extension_slug : " transactions"
3188
+ name : " INCR Command (2/3)"
3189
+ difficulty : easy
3190
+ description_md : |
3191
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3192
+
3193
+ ### Tests
3194
+
3195
+ The tester will execute your program as a master like this:
3196
+
3197
+ ```
3198
+ ./spawn_redis_server.sh
3199
+ ```
3200
+
3201
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3202
+
3203
+ ```bash
3204
+ $ redis-cli INCR foo
3205
+ > INCR bar
3206
+ ```
3207
+
3208
+ marketing_md : |
3209
+ In this stage, you'll continue implementing the INCR command.
3210
+
3211
+ - slug : " mk1"
3212
+ primary_extension_slug : " transactions"
3213
+ name : " INCR Command (3/3)"
3214
+ difficulty : easy
3215
+ description_md : |
3216
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3217
+
3218
+ ### Tests
3219
+
3220
+ The tester will execute your program as a master like this:
3221
+
3222
+ ```
3223
+ ./spawn_redis_server.sh
3224
+ ```
3225
+
3226
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3227
+
3228
+ ```bash
3229
+ $ redis-cli SET foo xyz
3230
+ > INCR foo
3231
+ ```
3232
+
3233
+ marketing_md : |
3234
+ In this stage, you'll finish implementing the INCR command.
3235
+
3236
+ - slug : " pn0"
3237
+ primary_extension_slug : " transactions"
3238
+ name : " MULTI Command"
3239
+ difficulty : easy
3240
+ description_md : |
3241
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3242
+
3243
+ ### Tests
3244
+
3245
+ The tester will execute your program as a master like this:
3246
+
3247
+ ```
3248
+ ./spawn_redis_server.sh
3249
+ ```
3250
+
3251
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3252
+
3253
+ ```bash
3254
+ $ redis-cli MULTI
3255
+ ```
3256
+
3257
+ marketing_md : |
3258
+ In this stage, you'll implement the MULTI command.
3259
+
3260
+ - slug : " lo4"
3261
+ primary_extension_slug : " transactions"
3262
+ name : " EXEC Command"
3263
+ difficulty : easy
3264
+ description_md : |
3265
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3266
+
3267
+ ### Tests
3268
+
3269
+ The tester will execute your program as a master like this:
3270
+
3271
+ ```
3272
+ ./spawn_redis_server.sh
3273
+ ```
3274
+
3275
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3276
+
3277
+ ```bash
3278
+ $ redis-cli EXEC
3279
+ ```
3280
+
3281
+ marketing_md : |
3282
+ In this stage, you'll start implementing the EXEC command.
3283
+
3284
+ - slug : " we1"
3285
+ primary_extension_slug : " transactions"
3286
+ name : " Empty transaction"
3287
+ difficulty : hard
3288
+ description_md : |
3289
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3290
+
3291
+ ### Tests
3292
+
3293
+ The tester will execute your program as a master like this:
3294
+
3295
+ ```
3296
+ ./spawn_redis_server.sh
3297
+ ```
3298
+
3299
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3300
+
3301
+ ```bash
3302
+ $ redis-cli MULTI
3303
+ > EXEC
3304
+ > EXEC
3305
+ ```
3306
+
3307
+ marketing_md : |
3308
+ In this stage, you'll implement an empty transaction.
3309
+
3310
+ - slug : " rs9"
3311
+ primary_extension_slug : " transactions"
3312
+ name : " Queueing Commands"
3313
+ difficulty : medium
3314
+ description_md : |
3315
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3316
+
3317
+ ### Tests
3318
+
3319
+ The tester will execute your program as a master like this:
3320
+
3321
+ ```
3322
+ ./spawn_redis_server.sh
3323
+ ```
3324
+
3325
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3326
+
3327
+ ```bash
3328
+ $ redis-cli MULTI
3329
+ > SET foo 41
3330
+ > INCR foo
3331
+ ```
3332
+
3333
+ The tester will then create another connection to your master as a Redis client, and send a single command:
3334
+
3335
+ ```bash
3336
+ $ redis-cli GET foo
3337
+ ```
3338
+
3339
+ marketing_md : |
3340
+ In this stage, you'll implement queueing commands to a transaction.
3341
+
3342
+ - slug : " fy6"
3343
+ primary_extension_slug : " transactions"
3344
+ name : " Executing a transaction"
3345
+ difficulty : hard
3346
+ description_md : |
3347
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3348
+
3349
+ ### Tests
3350
+
3351
+ The tester will execute your program as a master like this:
3352
+
3353
+ ```
3354
+ ./spawn_redis_server.sh
3355
+ ```
3356
+
3357
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3358
+
3359
+ ```bash
3360
+ $ redis-cli MULTI
3361
+ > SET foo 6
3362
+ > INCR foo
3363
+ > INCR bar
3364
+ > GET bar
3365
+ > EXEC
3366
+ ```
3367
+
3368
+ The tester will then create another connection to your master as a Redis client, and send a single command:
3369
+
3370
+ ```bash
3371
+ $ redis-cli GET foo
3372
+ ```
3373
+
3374
+ marketing_md : |
3375
+ In this stage, you'll implement executing a successful transaction.
3376
+
3377
+ - slug : " rl9"
3378
+ primary_extension_slug : " transactions"
3379
+ name : " DISCARD Command"
3380
+ difficulty : easy
3381
+ description_md : |
3382
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3383
+
3384
+ ### Tests
3385
+
3386
+ The tester will execute your program as a master like this:
3387
+
3388
+ ```
3389
+ ./spawn_redis_server.sh
3390
+ ```
3391
+
3392
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3393
+
3394
+ ```bash
3395
+ $ redis-cli MULTI
3396
+ > SET foo 41
3397
+ > INCR foo
3398
+ > DISCARD
3399
+ > GET foo
3400
+ > GET bar
3401
+ > DISCARD
3402
+ ```
3403
+
3404
+ marketing_md : |
3405
+ In this stage, you'll implement the DISCARD command.
3406
+
3407
+ - slug : " sg9"
3408
+ primary_extension_slug : " transactions"
3409
+ name : " Failures within transactions"
3410
+ difficulty : medium
3411
+ description_md : |
3412
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3413
+
3414
+ ### Tests
3415
+
3416
+ The tester will execute your program as a master like this:
3417
+
3418
+ ```
3419
+ ./spawn_redis_server.sh
3420
+ ```
3421
+
3422
+ The tester will then connect to your master as a Redis client, and send multiple commands using the same connection:
3423
+
3424
+ ```bash
3425
+ $ redis-cli SET foo abc
3426
+ > SET bar 7
3427
+ > MULTI
3428
+ > INCR foo
3429
+ > INCR bar
3430
+ > EXEC
3431
+ ```
3432
+
3433
+ The tester will then create another connection to your master as a Redis client, and send a single command:
3434
+
3435
+ ```bash
3436
+ $ redis-cli GET foo
3437
+ > GET bar
3438
+ ```
3439
+
3440
+ marketing_md : |
3441
+ In this stage, you'll implement handling failures while executing a transaction.
3442
+
3443
+ - slug : " jf8"
3444
+ primary_extension_slug : " transactions"
3445
+ name : " Multiple transactions"
3446
+ difficulty : medium
3447
+ description_md : |
3448
+ **🚧 We're still working on instructions for this stage**. You can find notes on how the tester works below.
3449
+
3450
+ ### Tests
3451
+
3452
+ The tester will execute your program as a master like this:
3453
+
3454
+ ```
3455
+ ./spawn_redis_server.sh
3456
+ ```
3457
+
3458
+ The tester will then connect to your master as multiple Redis clients, and send multiple commands from each connection:
3459
+
3460
+ ```bash
3461
+ $ redis-cli MULTI
3462
+ > INCR foo
3463
+ > EXEC
3464
+ ```
3465
+
3466
+ marketing_md : |
3467
+ In this stage, you'll implement multiple concurrent transactions.
0 commit comments