摘要:
一,代码: binding.button1.setOnClickListener { System.setProperty("kotlinx.coroutines.debug", "on") println("main线程开始:${Thread.currentThread().name}") run 阅读全文
posted @ 2025-07-19 07:47
刘宏缔的架构森林
阅读(44)
评论(0)
推荐(0)
摘要:
一,代码: binding.button1.setOnClickListener { println("sleep1 start,") // 协程已在等待时主线程还在继续 Thread.sleep(200L) // 阻塞主线程 0.2 秒钟 println("sleep1 end,") // 协程已 阅读全文
posted @ 2025-07-19 07:47
刘宏缔的架构森林
阅读(65)
评论(0)
推荐(0)
摘要:
一,代码: binding.button1.setOnClickListener { //启动debug模式,可以打印协程的编号 System.setProperty("kotlinx.coroutines.debug", "on") println("runBlocking外运行: ${Threa 阅读全文
posted @ 2025-07-19 07:47
刘宏缔的架构森林
阅读(44)
评论(0)
推荐(0)
摘要:
一,用runBlocking创建协程 1,代码: binding.button1.setOnClickListener { System.setProperty("kotlinx.coroutines.debug", "on") val count = AtomicInteger() val for 阅读全文
posted @ 2025-07-19 07:47
刘宏缔的架构森林
阅读(15)
评论(0)
推荐(0)
摘要:
一,代码: //处理按钮点击事件,创建一个假数据,保存到viewmodel binding.button1.setOnClickListener { //只有一个函数类型作为函数参数 fun highOrderFunction(operation: (Int, Int) -> Int): Int { 阅读全文
posted @ 2025-07-19 07:46
刘宏缔的架构森林
阅读(36)
评论(0)
推荐(0)
摘要:
一,代码: binding.button1.setOnClickListener { //定义一个函数类型的变量,用来返回参数的平方 val square: (Int) -> Int = { it * it } // `it` 代表传入的参数 println("square(5)的结果:"+squa 阅读全文
posted @ 2025-07-19 07:46
刘宏缔的架构森林
阅读(38)
评论(0)
推荐(0)
摘要:
一,代码: // 1 . 声明函数类型,需放在顶层,不能在类和方法中 typealias mathAdd = (Int, Int) -> Int ... //处理按钮点击事件 binding.button1.setOnClickListener { // 2 . 为预定义函数类型实例化 var ad 阅读全文
posted @ 2025-07-19 07:46
刘宏缔的架构森林
阅读(19)
评论(0)
推荐(0)
摘要:
一,安装第三方库: 文档地址: https://www.workerman.net/doc/webman/components/crontab.html 从命令行安装: $ composer require workerman/crontab ./composer.json has been upd 阅读全文
posted @ 2025-07-19 07:46
刘宏缔的架构森林
阅读(85)
评论(0)
推荐(0)
摘要:
一,代码: binding.button2.setOnClickListener { println("点击代码块开始:") runBlocking { // 1 launch { val threadId = Thread.currentThread().id val threadName = T 阅读全文
posted @ 2025-07-19 07:44
刘宏缔的架构森林
阅读(18)
评论(0)
推荐(0)
摘要:
一,代码: //launch binding.button1.setOnClickListener { println("点击代码块开始:") GlobalScope.launch { // 1 println("Launch执行开始") // 2 delay(1000L) // 3 println 阅读全文
posted @ 2025-07-19 07:44
刘宏缔的架构森林
阅读(85)
评论(0)
推荐(0)
摘要:
一,下载安装包 官方地址: https://github.com/phpredis/phpredis/tags 因为要针对旧版本,我们使用以前下载的安装包 二,安装 解压 $ tar -zxvf redis-2.2.8.tgz 配置扩展库 cd redis-2.2.8 $ /data/softwar 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(23)
评论(0)
推荐(0)
摘要:
一,用-i参数: # /data/software/php/bin/php -i | grep 'Configuration File' Configuration File (php.ini) Path => /etc Loaded Configuration File => /etc/php.i 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(26)
评论(0)
推荐(0)
摘要:
一,默认启动时的进程 root 927 0.9 1.7 8399844 284276 pts/1 Sl 13:48 0:13 /data/soft/jdk1.8.0_71/jre/bin/java -Djava.util.logging.config.file=/data/soft/apache-t 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(25)
评论(0)
推荐(0)
摘要:
一,用grant命令新建用户,同时授权 GRANT ALL PRIVILEGES ON your_db.* TO 'your_user_name'@your.app.ip.addr IDENTIFIED BY 'your pass'; flush privileges 二,检查效果: 查看mysql 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(14)
评论(0)
推荐(0)
摘要:
一,下载 tomcat的官网: https://tomcat.apache.org/ 这里使用之前下载好的安装包 二,安装 解压: # unzip apache-tomcat-8.0.28.zip 移动到安装目录下: # mv apache-tomcat-8.0.28 /data/soft/ 配置环 阅读全文
一,下载 tomcat的官网: https://tomcat.apache.org/ 这里使用之前下载好的安装包 二,安装 解压: # unzip apache-tomcat-8.0.28.zip 移动到安装目录下: # mv apache-tomcat-8.0.28 /data/soft/ 配置环 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(10)
评论(0)
推荐(0)
摘要:
一,下载 官方网站: https://www.oracle.com/cn/java 需要注册账号, 我们需要的版本是jdk1.8.0_60官网已经不提供了,只能下载与之相近的版本: 解压: # tar -zxvf jdk-8u71-linux-x64.tar.gz 二,安装 把解压出来的目录,移动到 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(27)
评论(0)
推荐(0)
摘要:
一,安装 解压 # tar -zxvf redis-3.2.8.tar.gz 进入源码目录,编译: ]# cd redis-3.2.8 # make 安装: # make install PREFIX=/data/soft/redis-3.2.8 配置: 把源码目录中的redis.conf复制到安装 阅读全文
posted @ 2025-07-19 07:43
刘宏缔的架构森林
阅读(26)
评论(0)
推荐(0)
摘要:
一,遇到的问题: 看到一个进程,想知道这个进程的工作目录,如下: # ps auxfww | grep redis root 22715 0.0 0.0 103252 828 pts/3 S+ 17:10 0:00 | \_ grep redis root 25816 0.0 0.7 455064 阅读全文
posted @ 2025-07-19 07:41
刘宏缔的架构森林
阅读(51)
评论(0)
推荐(0)
摘要:
一,安装 用yum从命令行安装 # yum install memcached 查看版本: # memcached -h memcached 1.4.4 -p <num> TCP port number to listen on (default: 11211) .. 查看服务状态 # servic 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(8)
评论(0)
推荐(0)
摘要:
一,配置: 动态ip 的网段 server 10.8.0.0 255.255.255.0 静态ip:放服务器,网段 route 10.8.1.0 255.255.255.0 给客户端推路由,对应静态ip的,否则客户端不能访问 push "route 10.8.1.0 255.255.255.0" c 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,问题 配置ifconfig-pool-persist ipp.txt后,不起作用,客户端的ip每次重启仍然会变化 二,查找原因 # grep persist /var/log/openvpn.log WARNING: --ifconfig-pool-persist will not work w 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,配置 在openvpn服务端所在机器上配置: # vi /etc/openvpn/server/server.conf 把下面一行取消注释 client-config-dir ccd 然后在/etc/openvpn下创建ccd目录 # mkdir ccd # cd ccd # vi client 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,安装 升级apt源 # apt update 用apt安装 # apt install openvpn 二,配置并连接 复制配置文件到client目录下: 进入目录 # cd /etc/openvpn/client/ 复制文件: # cp -axv /home/liuhongdi/work/cl 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,配置文件位置 如图: 项目->config->plugin->webman->console->app.php 二,内容: <?php return [ 'enable' => true, 'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'bui 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(20)
评论(0)
推荐(0)
摘要:
一,客户端机器:安装openvpn 用yum安装 # yum install openvpn 查看当前版本: # openvpn --version OpenVPN 2.5.11 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(1)
评论(0)
推荐(0)
摘要:
一,出现错误的代码: 1,代码 func startBackgroundJob() { ticker := time.NewTicker(1 * time.Minute) timeStop, _ := time.Parse("2006-01-02 15:04:05", "2025-07-08 09: 阅读全文
posted @ 2025-07-19 07:40
刘宏缔的架构森林
阅读(77)
评论(0)
推荐(0)
摘要:
一,代码 //定时运行功能, func startBackgroundJob() { ticker := time.NewTicker(1 * time.Minute) go func() { for range ticker.C { // 执行后台任务逻辑 now := time.Now() // 阅读全文
posted @ 2025-07-19 07:39
刘宏缔的架构森林
阅读(11)
评论(0)
推荐(0)
摘要:
一,文档 地址 https://www.workerman.net/q/14237 二,子进程退出: 代码: Worker::stopAll(); 例子: public function list(Request $request) { Worker::stopAll(); $where = []; 阅读全文
posted @ 2025-07-19 07:39
刘宏缔的架构森林
阅读(14)
评论(0)
推荐(0)
摘要:
一,报错信息 某个站点测试用octane运行后又改回通过php-fpm运行, 访问时报错: In Application.php line 933: Class "Laravel\Octane\OctaneServiceProvider" not found 二,解决: 原因是因为之前为项目安装过o 阅读全文
posted @ 2025-07-19 07:38
刘宏缔的架构森林
阅读(26)
评论(0)
推荐(0)
浙公网安备 33010602011771号