Tag:caller

  • C + + function pointer description

    Time:2022-5-3

    The following essay explains the usage of function pointers. Definition of function pointer: Definition form: Storage type data type (* function pointer name) () meaning: The function pointer points to the program code storage area Typical use of function pointer —– implement function callback Function called through function pointer For example, the pointer of a […]

  • IOS message mechanism obj_ Msgsend and super

    Time:2022-4-24

    1、 Premise View OC compiled code: xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.mCan generate main M compiled file will generate main Cpp file is the file from OC to C. We can analyze some OC features through this cpp file. 2、 Message mechanism obj_ msgsend 1. Analysis through several figures: [picture uploading… (screenshot 2021-07-03, […]

  • Hystrix go service avalanche solution weapon

    Time:2022-4-3

    preface In distributed systems, the whole system becomes unavailable because a service is unavailable. This situation is called service avalanche. Service avalanche In the above figure, a is the service provider, B is the service caller of a, and C and D are the service callers of B When the unavailability of a causes the […]

  • Design mode – responsibility chain mode

    Time:2022-3-6

    As an office worker, we may often hear complaints such as “chaotic management process” and “unclear responsibility boundary”, which are the problems that we have to face when a person or a department cannot complete a cause independently after the development of the organization or system. Take the usual leave as an example. Imagine that […]

  • Handling mistakes gracefully is really a knowledge!

    Time:2022-3-4

    errors You must have used this standard libraryerrorsThe implementation of the error is relatively simple, and stack tracing cannot be carried out. It is not very friendly to the upper caller when the error occurs, and the detailed information of the wrong call chain cannot be obtained. //Without stack err := errors.New(“error msg”) fmt.Printf(“%+v\n”, err) […]

  • 9 common and convenient Java exception handling methods to help you get rid of the tedious

    Time:2022-2-20

    preface Exception handling in Java is not a simple topic. It’s hard for beginners to understand that even experienced developers can spend hours discussing how and which exceptions should be thrown or handled. This is why most development teams have a set of rules on how to use them. If you are a novice, you […]

  • Setobject: forkey: and setValue: forkey:

    Time:2022-2-9

    1: Differences and relations between setobject: forkey: and setValue: forkey: 1. Setobject: forkey: unique to nsmutabledictionary;SetValue: forkey: is the main method of KVC; 2. Setobject: forkey:Object cannot be nil, otherwise an error will be reported ;As long as the parameter of key is an object, it is not limited to nsstring ; The value in […]

  • What is the generic difference of typescript?

    Time:2022-2-1

    Write a function where the type of input is related to the type of output, or the types of two inputs are related in some way. Let’s consider a function that returns the first element of the array: function firstElement(arr: any[]) { return arr[0];}This function does its job, but unfortunately the return type is any. […]

  • Command mode of design mode

    Time:2022-1-20

    Introduction to command mode The initial feeling of command mode is to separate the logical implementation from the operation request, reduce the coupling and facilitate expansion. The command pattern is a behavior pattern that uses data-driven methods toCommand object, passed to the caller in the form of a constructor. The caller then provides the corresponding […]

  • The paging query is wrapped as an iterator or returned as a stream

    Time:2021-10-23

    Paging query requires the caller to pass page number and page size information. It is a technical means to solve the problem that the consumer cannot accept so much data at one time due to the large amount of data. For the consumer with the concept of “page”, it is indeed convenient and effective to […]

  • 8 lock object

    Time:2021-9-22

    How to judge who the lock object is! Always know what a lock is and who it is!Deep understanding of locks first group /** *8 locks are 8 questions about locks *1. Under standard conditions, two threads print, send SMS or call: print and send SMS first *2. Sendsms is delayed for 4 seconds. Two […]

  • Generic function of typescript

    Time:2021-9-18

    Official link Write a function where the type of input is related to the type of output, or the types of two inputs are related in some way. Let’s consider a function that returns the first element of the array: function firstElement(arr: any[]) { return arr[0]; } This function does its job, but unfortunately the […]