Skip to content

Commit d7a2e0e

Browse files
authored
Update intro.md
1 parent 2a7c059 commit d7a2e0e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/uc/intro.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,19 @@ In many applications, tasks need to be processed asynchronously, such as maintai
110110

111111
```redis:[run_confirmation=true]
112112
// Create a new job as a Hash
113-
HSET sample_jobQueue:ticket:101 id 101 user_id 123 description "Unable to access console" priority "High" created_at "2024-04-20T12:00:00Z"
114-
115-
// Enqueue the new job
116-
LPUSH sample_jobQueue:helpdesk uuid86106205
113+
HSET sample_jobQueue:ticket:199 id 199 user_id 723 description "Unable to access console" priority "High" created_at "2024-04-20T12:00:00Z"
114+
```
115+
```redis:[run_confirmation=true]
116+
// Enqueue the new job to the waiting list
117+
LPUSH sample_jobQueue:waitingList sample_jobQueue:ticket:199
117118
```
118-
119119
```redis:[run_confirmation=true]
120-
// Dequeue a job
121-
RPOP sample_jobQueue:helpdesk
120+
// Show the full list of jobs
121+
LRANGE sample_jobQueue:waitingList 0 -1
122+
```
123+
```redis:[run_confirmation=true]
124+
// Dequeue a job from the list
125+
RPOP sample_jobQueue:waitingList
122126
```
123127

124128
### Leaderboard
@@ -133,4 +137,4 @@ ZADD sample_leaderboard:tetris 670000 "user100"
133137
```redis:[run_confirmation=true]
134138
// Get the top 5 users on the leaderboard, with scores
135139
ZRANGE sample_leaderboard:tetris 0 4 REV WITHSCORES
136-
```
140+
```

0 commit comments

Comments
 (0)