The useEffect Hook is React’s main approach to handling Side Effects. Side Effects refer to anything that affects something outside the scope of the function being executed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"os/signal" | |
"syscall" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
// Worker function that listens for a job on its own channel | |
func worker(id int, jobChannel chan int) { | |
for job := range jobChannel { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ( | |
Unknown nodeType = iota | |
Sync | |
Async | |
Fanout | |
) | |
func getNodeType(node Node) nodeType { | |
if _, isSync := node.(SyncNode); isSync { | |
return Sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
// Define a function type called 'mathOperation' | |
type mathOperation func(int, int) int | |
// Define some functions that match the 'mathOperation' type | |
func add(a, b int) int { | |
return a + b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Worker Pool : Distribute tasks efficiently among multiple goroutines | |
Fan-out, Fan-in Multiple workers process tasks; results are collected | |
Pipeline Process data through multiple stages | |
Pub-Sub One publisher sends messages to multiple subscribers | |
Rate Limiting Control request rate to prevent overload | |
Timeout Prevent indefinite blocking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
// worker function that runs in a separate goroutine | |
func worker(id int, ch chan string) { | |
time.Sleep(time.Second) // Simulate some work |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
// Define a struct for map operations | |
type MapOperation struct { | |
Key int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"os" | |
"os/signal" | |
"sync" | |
"syscall" |
https://www.thoughtworks.com/radar/techniques/micro-frontends
NX + NextJS + module federation
https://valor-software.com/articles/nx-next-js-and-module-federation#_next_js_module_federation
https://app.privjs.com/buy/packageDetail?pkg=@module-federation/nextjs-ssr#whats-shared-by-default
Module Federaion Docs \ https://github.com/sokra/slides/blob/master/content/ModuleFederationWebpack5.md
NewerOlder