Skip to content

Commit

Permalink
docs: update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
weyoss committed Mar 24, 2024
1 parent 96a2666 commit d80beb2
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
6 changes: 3 additions & 3 deletions examples/javascript/using-async-await.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const {
ProducibleMessage,
Queue,
EQueueType,
EQueueDeliveryMode,
EQueueDeliveryModel,
Configuration,
} = require('../..');
} = require('redis-smq');

const config = {
namespace: 'ns1',
Expand Down Expand Up @@ -59,7 +59,7 @@ const createQueue = async () => {
await queue.saveAsync(
'test_queue',
EQueueType.LIFO_QUEUE,
EQueueDeliveryMode.POINT_TO_POINT,
EQueueDeliveryModel.POINT_TO_POINT,
);
await queue.shutdownAsync();
}
Expand Down
6 changes: 3 additions & 3 deletions examples/javascript/using-async-await.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import bluebird from 'bluebird';
import {
Configuration,
Consumer,
EQueueDeliveryMode,
EQueueDeliveryModel,
EQueueType,
Producer,
ProducibleMessage,
Queue,
} from '../..'; // redis-smq
} from 'redis-smq';

const { promisifyAll } = bluebird;

Expand Down Expand Up @@ -61,7 +61,7 @@ const createQueue = async () => {
await queue.saveAsync(
'test_queue',
EQueueType.LIFO_QUEUE,
EQueueDeliveryMode.POINT_TO_POINT,
EQueueDeliveryModel.POINT_TO_POINT,
);
await queue.shutdownAsync();
}
Expand Down
12 changes: 6 additions & 6 deletions examples/javascript/using-callbacks.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@
* in the root directory of this source tree.
*/

const { logger, ERedisConfigClient } = require('redis-smq-common');
const { ERedisConfigClient, logger } = require('redis-smq-common');
const {
Configuration,
Consumer,
Producer,
ProducibleMessage,
Queue,
Configuration,
EQueueType,
EQueueDeliveryMode,
} = require('../..'); // redis-smq
EQueueDeliveryModel,
ProducibleMessage,
} = require('redis-smq');

const config = {
namespace: 'ns1',
Expand Down Expand Up @@ -57,7 +57,7 @@ const createQueue = (cb) => {
queue.save(
'test_queue',
EQueueType.LIFO_QUEUE,
EQueueDeliveryMode.POINT_TO_POINT,
EQueueDeliveryModel.POINT_TO_POINT,
(err) => {
if (err) cb(err);
else queue.shutdown(cb);
Expand Down
12 changes: 6 additions & 6 deletions examples/javascript/using-callbacks.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ import { ERedisConfigClient, logger } from 'redis-smq-common';
import {
Configuration,
Consumer,
EQueueDeliveryMode,
EQueueType,
Message,
Producer,
Queue,
} from '../..'; // redis-smq
EQueueType,
EQueueDeliveryModel,
ProducibleMessage,
} from 'redis-smq';

const config = {
namespace: 'ns1',
Expand Down Expand Up @@ -57,7 +57,7 @@ const createQueue = (cb) => {
queue.save(
'test_queue',
EQueueType.LIFO_QUEUE,
EQueueDeliveryMode.POINT_TO_POINT,
EQueueDeliveryModel.POINT_TO_POINT,
(err) => {
if (err) cb(err);
else queue.shutdown(cb);
Expand All @@ -72,7 +72,7 @@ const produce = (cb) => {
producer.run((err) => {
if (err) cb(err);
else {
const msg = new Message();
const msg = new ProducibleMessage();
msg
.setBody({ ts: `Current time is ${Date.now()}` })
.setQueue('test_queue');
Expand Down
4 changes: 3 additions & 1 deletion examples/typescript/using-async-await.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* in the root directory of this source tree.
*/

import { promisifyAll } from 'bluebird';
import bluebird from 'bluebird';
import { ERedisConfigClient, logger } from 'redis-smq-common';
import {
Configuration,
Expand All @@ -20,6 +20,8 @@ import {
Queue,
} from '../../index.js'; // redis-smq

const { promisifyAll } = bluebird;

export const config: IRedisSMQConfig = {
namespace: 'ns1',
redis: {
Expand Down

0 comments on commit d80beb2

Please sign in to comment.