Created
October 20, 2021 10:37
-
-
Save velotiotech/a05239bf9e98ae5cd7b078eae7a67930 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async subscribe({ topic, ttl }) { | |
return dynamoDBClient | |
.put({ | |
Item: { | |
topic, | |
connectionId: this.connectionId, | |
ttl: typeof ttl === 'number' ? ttl : Math.floor(Date.now() / 1000) + 60 * 60 * 2, | |
}, | |
TableName: process.env.TOPICS_TABLE, | |
}).promise(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment