Requirements: Use websocket to implement publishing, subscribing, network disconnection and reconnection, and account squeezing after single sign-in without using plug-ins. 1. Single sign-on (only one of the same account is online at the same time, multiple user logins are prohibited) Implementation: After the user logs in, the token token is obtained and stored locally. It […]
Tag: subscribe
Subscriber of Fast DDS
Directory Subscriber SubscriberQos SubscriberListener Create Subscriber DataReader SampleInfo Read data Get data through callback Processed by starting a waiting thread Subscriber plays the role of a container, and there can be many DataReaders in it. They use the same SubscriberQos configuration of Subscriber. Subscriber can carry DataReader objects of different Topics and data types. Subscriber […]
Use the Redis publish and subscribe function to implement dynamic registration monitoring and asynchronous retrieval of results
Introduction and objectives Publish/subscribe is very commonly used in our system development. Redis also provides this function, but it implements relatively basic functions. Redis cannot achieve these functions of reliable message publishing, subscription and message accumulation. But we can still use it to handle many business scenarios, such as: Our system uses services to call […]
Subscribe to topics from rosbag–take images as an example
This article is a supplement to the CSDN blog that uses the subscription function of ROS topics to extract information from bag files_rosbag extracts multiple topic information. ROS creates workspace code with one click conda deactivate # if necessary # Check path echo “the current space is ” pwd #Initialize workspace mkdir -p ./rosbag-ext/src cd […]
Use the Redis publish-subscribe model to implement session sharing
In fact, it is not to realize session sharing, but to use redis publish and subscribe, so that all cluster servers can send messages to their own sessions. For example, if userId is on the 35th server and there are 100 servers, then the first server receives the message and needs to notify userId. Instead […]
Handwritten redux connect method, using subscribe to get the latest data
1. Public method files 1. connect file import React, { useState } from “react”; import MyContext from “./MyContext”; import _ from “lodash”; // Simulate the connect high-order function of react-redux const connect = (mapStateToProps, mapDispatchToProps) => { return (Component) => props => wrapper(Component, {mapStateToProps, mapDispatchToProps, …props}); }; const wrapper = (Comp, props) => { const […]
SpringBoot+Redis publish-subscribe mode encapsulates custom annotations for logs between microservices
Scene: In projects, system operation records are usually saved as logs in order to record user operation behaviors and analyze system problems when system failures occur. In order to maintain the low intrusion of code and the standardization of log data between microservices, You can use custom log annotations to achieve the above purpose, and […]
Redis publish-subscribe model
We know that Redis is often used as a cache server. In fact, in addition to caching, redis also has the function of publish and subscribe. Today we will briefly take a look at the functions and usage of the publish and subscribe model of redis. 1. Basic principles The publish-subscribe model is a message […]