Class: User

User

通过IPC读写共享内存的类

new User()

Source:
Returns:
A new instance of User

Members

<private> __getCallbacks__ :Object

缓存读写操作的回调函数
Type:
  • Object
Source:

Methods

get(key, cb)

读取数据
Parameters:
Name Type Description
key string
cb User~getCallback 回调函数
Source:

<private> handle(method, key, value, cb)

处理通信的方法
Parameters:
Name Type Argument Default Description
method string <optional>
set|get
key string
value *
cb User~handleCallback 回调函数
Source:

remove(key, cb)

删除数据
Parameters:
Name Type Description
key string
cb User~removeCallback 回调函数
Source:

set(key, value, cb)

写入数据
Parameters:
Name Type Description
key string
value * 值(不建议使用function类型)
cb User~setCallback 回调函数
Source:

<private> uuid() → {number}

获取每次通信的uuid
Source:
Returns:
Type
number

Type Definitions

getCallback(data)

Parameters:
Name Type Description
data * key对应的数据
Source:

handleCallback(data)

Parameters:
Name Type Description
data string
Source:

removeCallback(data)

Parameters:
Name Type Description
data string 'OK'表示成功
Source:

setCallback(data)

Parameters:
Name Type Description
data string 'OK'表示成功
Source: