-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from juitnow/noref-interval
Un-reference intervals and timeouts
- Loading branch information
Showing
15 changed files
with
1,261 additions
and
1,203 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "memx", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Simple and fast memcached client", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
|
@@ -28,14 +28,14 @@ | |
"author": "Juit Developers <[email protected]>", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@plugjs/build": "^0.4.7", | ||
"@types/chai": "^4.3.5", | ||
"@types/chai-as-promised": "^7.1.5", | ||
"@types/memjs": "^1.3.0", | ||
"chai": "^4.3.7", | ||
"@plugjs/build": "^0.5.22", | ||
"@types/chai": "^4.3.11", | ||
"@types/chai-as-promised": "^7.1.8", | ||
"@types/memjs": "^1.3.3", | ||
"chai": "<5.0.0", | ||
"chai-as-promised": "^7.1.1", | ||
"chai-exclude": "^2.1.0", | ||
"memjs": "^1.3.1" | ||
"memjs": "^1.3.2" | ||
}, | ||
"directories": { | ||
"test": "test" | ||
|
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,15 @@ | ||
export type { RecyclableBuffer } from './buffers' | ||
|
||
import * as connection from './connection' | ||
import * as constants from './constants' | ||
import * as decode from './decode' | ||
import * as encode from './encode' | ||
import * as constants from './constants' | ||
import * as connection from './connection' | ||
|
||
export { | ||
decode, | ||
encode, | ||
constants, | ||
connection, | ||
} | ||
export { connection, constants, decode, encode } | ||
|
||
export * from './fake' | ||
export * from './types' | ||
export * from './client' | ||
export * from './cluster' | ||
export * from './fake' | ||
export * from './server' | ||
export * from './client' | ||
export * from './types' | ||
export * from './utils' |
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* eslint-disable no-console */ | ||
import { log } from '@plugjs/build' | ||
|
||
import { MemxClient, PoorManLock } from '../src/index' | ||
|
||
const host = process.env.MEMCACHED_HOST || '127.0.0.1' | ||
const port = parseInt(process.env.MEMCACHED_PORT || '11211') | ||
const client = new MemxClient({ hosts: [ { host, port } ] }) | ||
|
||
async function test(): Promise<void> { | ||
console.log(`Child process using lock "${process.argv[2]}"`) | ||
|
||
const lock = new PoorManLock(client, process.argv[2]) | ||
try { | ||
await lock.execute(async () => { | ||
console.log('Child process locking') | ||
await new Promise((resolve) => void setTimeout(resolve, 2000)) | ||
console.log('Child process exiting') | ||
process.exit(123) | ||
}, { owner: `test-child-${process.pid}` }) | ||
} finally { | ||
console.log('Child process exit interrupted ???') | ||
process.exit(123) | ||
} | ||
} | ||
|
||
test().catch((error) => log.error('Error in child process test', error)) |