当前位置:网站首页>PHP laravel+gatewayworker completes im instant messaging and file transfer functions (Chapter 2: explanation of business logic)
PHP laravel+gatewayworker completes im instant messaging and file transfer functions (Chapter 2: explanation of business logic)
2022-06-26 12:18:00 【Special sword】
laravel+GatewayWorker complete IM Instant messaging and file transfer ( Chapter two : Explanation of business logic )
Function introduction
This topic will lead you to build Imitation A letter Of Instant messaging And complete the mutual transmission of documents
Application scenarios
Practical application scenarios of this topic :
- Chat customer service : Instant messaging , Messages are transmitted to each other in real time , Send text to each other 、 Voice messages and files ;
- Small scale online auction ;
- Video live barrage ;
- The Internet of things ;
- And other functions related to real-time messages ;
Special sections
- Server configuration
- Explanation of business logic
- Back end instant messaging code development and configuration item explanation
- Server debugging error
- Front and back end code development
- Function display
Chapter two : Explanation of business logic
One 、 Business logic
The specific implementation principle manual is more detailed than what I said GatewayWorker working principle ;
Now let me briefly say , In the past without electronic communication equipment , It takes a few steps to have a word with you in the distance ?
- I write what I want to say on the letter paper with a pen ;→ Type in the text input
- I sent this letter to the post office and told the address to receive it ;→ Click on button The button is submitted to the controller written by us at the back end
- The post office will deliver the letter to you according to the address ;→ Our controller according to the letter “ Receiving address ” call
Gateway::sendToClient($ Receiving address , $ The content of the letter );Send you a letter - You open the letter and read ;→ user B Of web Front end chat page js adopt ws.onmessage() Method to receive the message and render it on the front-end template
- End of one-way communication ;→ Continuous connection ;
Then you want to reply to my letter in several steps ?
- You write what you want to say on the letter paper ;→ Write what you want to say in input in
- You take your letter to the post office, tell the receiving address and ask the mail to deliver it for you ;→ Click on button Submit button , Send content to our controller , Our controller is calling
Gateway::sendToClient($ Receiving address , $ The content of the letter );To deliver a letter - Find me by mail according to the receiving address and give me your letter ;→ user A Of web Front end chat page js adopt ws.onmessage() Method to receive incoming messages
- I opened it to read → user A Of web Front end chat page js adopt ws.onmessage() Method to receive the message and render it on the front-end template
This process is designed to cover those roles ?
- I ( user A): The first person to send you a letter
- you ( user B): The person who received my first letter
- Post Office : Someone who helps us deliver the letter
- Postman : Who helped us deliver the letter
Then map this process to what is in the program ?
- user : This is easy to understand , Is the person who uses this communication program ;
- Post Office : amount to MVC Inside the frame Controller Business controller ;
- Postman : Who helped us deliver the letter GatewayWorker
Last chapter :《1. Server configuration 》
Next chapter :《3. Back end instant messaging code development and configuration item explanation 》
边栏推荐
- 【概率论】条件概率、贝叶斯公式、相关系数、中心极限定理、参数估计、假设检验
- 这两天搭建环境遇到的几个问题
- Hello! Forward proxy!
- PolarisMesh系列文章——概念系列(一)
- One click deployment of your own community forum
- 1、 MySQL introduction
- Scala-day03- operators and loop control
- 4. N queen problem
- Quantitative elementary -- akshare obtains stock code, the simplest strategy
- Please advise tonghuashun which securities firm to choose for opening an account? Is it safe to open a mobile account?
猜你喜欢

Scala-day02- variables and data types
![[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure](/img/d2/a6cbb0abe9e04c412d1f6021430528.png)
[redis series] redis learning 16. Redis Dictionary (map) and its core coding structure

Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"

How to calculate flops and params in deep learning

Deep thinking from senior member managers

Statistical genetics: Chapter 2, the concept of statistical analysis

SQL injection in Pikachu shooting range

Omni channel member link - tmall member link 3: preparation of member operation content

HUST network attack and defense practice | 6_ IOT device firmware security experiment | Experiment 3 freertos-mpu protection bypass

Quantitative elementary -- akshare obtains stock code, the simplest strategy
随机推荐
NFS共享存储服务安装
Omnichannel membership - tmall membership 1: opening tutorial
4. N queen problem
2016年四川省TI杯电子设计竞赛B题
Five trends of member marketing of consumer goods enterprises in the future
Build Pikachu shooting range and introduction
统计遗传学:第二章,统计分析概念
JMeter response time and TPS listener tutorial
China's smart toy market outlook and investment strategy consulting forecast report from 2022 to 2027
国际美妆业巨头押注中国
女性科学家的流失
Black squares in word
Re recognized! Know that Chuangyu has been selected as one of the first member units of the "business security promotion plan"
Demand scale forecast and investment competitiveness analysis report of China's new material market 2022-2028
International beauty industry giants bet on China
Oracle锁表查询和解锁方法
【Redis 系列】redis 学习十六,redis 字典(map) 及其核心编码结构
Precautions for opening a securities account is it safe to open an account
Redis cannot connect to the server through port 6379
CG bone animation