摘要:需要完成功能 借助redis Stream 数据结构实现消息队列,异步完成订单创建,其中涉及到了缓存(击穿,穿透,雪崩),锁(Redisson),并发处理,异步处理,Lua脚本 IDE:IDEA 2022 1、读取库存数据 【Lua】 2、判断库存 【Lua】 3、扣减库存 【Lua】 4、创建队列
阅读全文
摘要:Lua 内存垃圾回收,是自动完成的,不需要人工处理。 垃圾回收有两种模式: 1、增量式(Incremental) 有三个参数 1)、garbage-collector pause, 什么时间执行,比上次回收后内增加的比例 默认200% 最大1000% 2)、garbage-collector ste
阅读全文
摘要:2.4 – Metatables and Metamethods Every value in Lua can have a metatable. This metatable is an ordinary Lua table that defines the behavior of the ori
阅读全文
摘要:2.5.8 – Function Calls A function call in Lua has the following syntax: functioncall ::= prefixexp args In a function call, first prefixexp and args a
阅读全文
摘要:2.5.7 – Table Constructors Table constructors are expressions that create tables. Every time a constructor is evaluated, a new table is created. A con
阅读全文
摘要:2.5.1 – Arithmetic Operators Lua supports the usual arithmetic operators: the binary + (addition), - (subtraction), * (multiplication), / (division),
阅读全文
摘要:2.5 – Expressions The basic expressions in Lua are the following: exp ::= prefixexp exp ::= nil | false | true exp ::= Number exp ::= String exp ::= f
阅读全文
摘要:结构控制 2.4.4 – Control Structures The control structures if, while, and repeat have the usual meaning and familiar syntax: stat ::= while exp do block e
阅读全文
摘要:变量 Variables are places that store values. There are three kinds of variables in Lua: global variables, local variables, and table fields. A single na
阅读全文
摘要:值和类型 Lua is a dynamically typed language. This means that variables do not have types; only values do. There are no type definitions in the language.
阅读全文
摘要:1、标识符 Names (also called identifiers) in Lua can be any string of letters, digits, and underscores, not beginning with a digit. Identifiers are used t
阅读全文
摘要:https://www.lua.org 下载 压缩文件 上传到linux /opt/software 解压 到 /opt/module/ tar -zxvf xx -C /opt/module/ cd lua-5.4.4/ make make install done! 交互式 输出 hello w
阅读全文