mirror of
https://github.com/Dvorinka/Devour.git
synced 2026-06-04 12:33:04 +00:00
17 lines
1.7 KiB
JSON
17 lines
1.7 KiB
JSON
{
|
|
"id": "7e7d82b3940ee4f540c30083",
|
|
"source": "solid:signals",
|
|
"type": "github-document",
|
|
"title": "get-server-function-meta",
|
|
"content": "---\ntitle: getServerFunctionMeta\nuse_cases: \u003e-\n server function identification, parallel processing, worker management,\n caching, multi-core apps\ntags:\n - server\n - functions\n - metadata\n - parallel\n - workers\n - cache\nversion: '1.0'\ndescription: \u003e-\n Get stable IDs for server functions across parallel instances. Enable caching\n and state management in multi-core SolidStart apps.\n---\n\n`getServerFunctionMeta` returns a function-specific id string, that is stable across all instances when server functions are run in parallel on multiple CPU cores or workers.\n\nThis `id` property can and _will_ change between builds.\n\n```tsx\nimport { getServerFunctionMeta } from \"@solidjs/start\";\n\n// or some in-memory db\nconst appCache: any = globalThis;\n\nconst counter = async () =\u003e {\n\t\"use server\";\n\tconst { id } = getServerFunctionMeta()!;\n\tconst key = `counter_${id}`;\n\tappCache[key] = appCache[key] ?? 0;\n\tappCache[key]++;\n\n\treturn appCache[key] as number;\n};\n```\n\n## Parameters\n\n`getServerFunctionMeta(): { id: string }`",
|
|
"url": "https://github.com/solidjs/solid-docs/blob/HEAD/src/routes/solid-start/reference/server/get-server-function-meta.mdx",
|
|
"metadata": {
|
|
"path": "src/routes/solid-start/reference/server/get-server-function-meta.mdx",
|
|
"repo": "solidjs/solid-docs",
|
|
"repo_url": "https://github.com/solidjs/solid-docs.git",
|
|
"size": 1025,
|
|
"source_type": "github"
|
|
},
|
|
"hash": "a8bda8ecbea3183e7d3f450640bf58e45189a494e25176673a62437b3392834a",
|
|
"timestamp": "2026-02-23T11:43:00.195220454+01:00"
|
|
} |