Home / Function/ Test_Hook_OnListenPrefork() — fiber Function Reference

Test_Hook_OnListenPrefork() — fiber Function Reference

Architecture documentation for the Test_Hook_OnListenPrefork() function in hooks_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  72763c54_729f_7d63_0035_091c506f108a["Test_Hook_OnListenPrefork()"]
  2d218330_4ff5_8bbe_d9c4_174410c41dd0["hooks_test.go"]
  72763c54_729f_7d63_0035_091c506f108a -->|defined in| 2d218330_4ff5_8bbe_d9c4_174410c41dd0
  style 72763c54_729f_7d63_0035_091c506f108a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

hooks_test.go lines 521–542

func Test_Hook_OnListenPrefork(t *testing.T) {
	t.Parallel()
	app := New()

	buf := bytebufferpool.Get()
	defer bytebufferpool.Put(buf)

	app.Hooks().OnListen(func(_ ListenData) error {
		_, err := buf.WriteString("ready")
		require.NoError(t, err)

		return nil
	})

	go func() {
		time.Sleep(1000 * time.Millisecond)
		assert.NoError(t, app.Shutdown())
	}()

	require.NoError(t, app.Listen(":0", ListenConfig{DisableStartupMessage: true, EnablePrefork: true}))
	require.Equal(t, "ready", buf.String())
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Hook_OnListenPrefork() do?
Test_Hook_OnListenPrefork() is a function in the fiber codebase, defined in hooks_test.go.
Where is Test_Hook_OnListenPrefork() defined?
Test_Hook_OnListenPrefork() is defined in hooks_test.go at line 521.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free