原文:openresty開發系列24--openresty中lua的引入及使用

openresty開發系列 openresty中lua的引入及使用openresty 引入 lua一 openresty中nginx引入lua方式 xxx by lua gt 字符串編寫方式 xxx by lua block gt 代碼塊方式 xxx by lua file gt 直接引用一個lua腳本文件我們案例中使用內容處理階段,用content by lua演示 編輯nginx.conf 第 ...

2019-08-30 11:52 0 1228 推薦指數:

查看詳情

openresty開發系列26--openresty使用redis模塊

openresty開發系列26--openresty使用redis模塊在一些高並發的場景,我們常常會用到緩存技術,現在我們常用的分布式緩存redis是最知名的,操作redis,我們需要引入redis模塊 require "resty.redis";我們現在做個可以操作redis進行賦值,讀值 ...

Fri Aug 30 19:59:00 CST 2019 0 1038
高並發 Nginx+Lua OpenResty系列(4)——Lua 模塊開發

在實際開發,不可能把所有代碼寫到一個大而全的lua文件,需要進行分模塊開發;而且模塊化是高性能Lua應用的關鍵。使用require第一次導入模塊后,所有Nginx 進程全局共享模塊的數據和代碼,每個Worker進程需要時會得到此模塊的一個副本(Copy-On-Write ...

Sun Jun 30 21:11:00 CST 2019 0 565
openresty開發系列28--openresty操作mysql

openresty開發系列28--openresty操作mysqlMysql客戶端 應用中最常使用的就是數據庫了,尤其mysql數據庫,那openresty lua如何操作mysql呢? 默認安裝OpenResty時已經自帶了該模塊。案例,mysql數據庫的常用操作,編輯 ...

Fri Aug 30 22:01:00 CST 2019 0 473
openresty開發系列25--openresty使用json模塊

openresty開發系列25--openresty使用json模塊web開發過程中,經常用的數據結構為json,openresty中封裝了json模塊,我們看如何使用一)如何引入cjson模塊,需要使用requirelocal json = require("cjson ...

Fri Aug 30 19:54:00 CST 2019 0 866
openresty開發系列30--openresty使用全局緩存

openresty開發系列30--openresty使用全局緩存Nginx全局內存---本地緩存使用過如Java的朋友可能知道如Ehcache等這種進程內本地緩存。Nginx是一個Master進程多個Worker進程的工作方式,因此我們可能需要在多個Worker進程中共享數據。使用 ...

Mon Sep 02 22:21:00 CST 2019 0 703
openresty + lua 4、openresty kafka

  kafka 官網: https://kafka.apache.org/quickstart   zookeeper 官網:https://zookeeper.apache.org/   kaf ...

Thu Nov 23 01:31:00 CST 2017 0 1234
openresty開發系列19--lua的table操作

openresty開發系列19--lua的table操作Luatable內部實際采用哈希表和數組分別保存鍵值對、普通值;下標從1開始不推薦混合使用這兩種賦值方式。local color={first="red", "blue", third="green", "yellow"}print ...

Fri Aug 30 18:18:00 CST 2019 0 426
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM