Type/to search
Built-in Functions
Global
Log
Market
Trade
Account
Futures
Exchange
IO
Network
Storage
Threads
exchange.Go
EventLoop
ctx.subscribe
ctx.poll
ctx.book
threading
Thread
ThreadLock
ThreadEvent
ThreadCondition
ThreadDict
ThreadDict.get
ThreadDict.set
Server
TA
Talib
OS
Structures
Built-in Variables and Constants
Conventions
Exchanges

Retrieves the value of a key recorded in a dictionary object.

get(key)

Examples

Use event objects to notify threads to read and modify data.

javascript
function main() { var threadRead = threading.Event() // the thread has read the data var mainChanged = threading.Event() // the main thread has changed the data var dict = threading.Dict() dict.set("data", 100) var t1 = threading.Thread(function(dict, threadRead, mainChanged) { Log(`thread1, dict.get("data"):`, dict.get("data")) threadRead.set() mainChanged.wait() Log(`after main change data, thread1 dict.get("data"):`, dict.get("data")) dict.set("data", 0) }, dict, threadRead, mainChanged) threadRead.wait() dict.set("data", 99) mainChanged.set() t1.join() Log(`main thread, dict.get("data"):`, dict.get("data")) }

Returns

TypeDescription

string / number / bool / object / array / any

Value corresponding to the key specified by the key parameter.

Arguments

NameTypeRequiredDescription

key

string

Yes

Key name to retrieve.

See Also