{"id":16315175,"url":"https://github.com/robrwo/class-method-cache-fastmmap","last_synced_at":"2025-05-05T19:51:41.970Z","repository":{"id":56838470,"uuid":"132200171","full_name":"robrwo/Class-Method-Cache-FastMmap","owner":"robrwo","description":null,"archived":false,"fork":false,"pushed_at":"2018-10-19T21:49:31.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-25T08:41:58.515Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robrwo.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-05T00:08:11.000Z","updated_at":"2018-10-19T21:49:33.000Z","dependencies_parsed_at":"2022-08-29T02:41:42.031Z","dependency_job_id":null,"html_url":"https://github.com/robrwo/Class-Method-Cache-FastMmap","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FClass-Method-Cache-FastMmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FClass-Method-Cache-FastMmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FClass-Method-Cache-FastMmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robrwo%2FClass-Method-Cache-FastMmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robrwo","download_url":"https://codeload.github.com/robrwo/Class-Method-Cache-FastMmap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239171314,"owners_count":19594039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T21:56:27.061Z","updated_at":"2025-02-16T17:52:30.516Z","avatar_url":"https://github.com/robrwo.png","language":"Perl","readme":"# NAME\n\nClass::Method::Cache::FastMmap - Cache method results using Cache::FastMmap\n\n# VERSION\n\nversion v0.3.3\n\n# SYNOPSIS\n\n```perl\npackage MyClass;\n\nuse Class::Method::Cache::FastMmap;\n\nsub my_method {\n  ...\n}\n\ncache 'my_method' =\u003e (\n   serializer  =\u003e 'storable',\n   expire_time =\u003e '1h',\n);\n```\n\n# DESCRIPTION\n\nThis package allows you to easily cache the results of a method call\nusing [Cache::FastMmap](https://metacpan.org/pod/Cache::FastMmap).\n\n# EXPORTS\n\n## `cache`\n\n```perl\ncache $method =\u003e %options;\n```\n\nThis wraps the `$method` with a function that caches the return value.\n\nIt assumes that the method returns a defined scalar value and that the\nmethod arguments are serialisable.\n\nThe `%options` are as follows:\n\n- `cache`\n\n    is used to specify a different (shared) cache. You may use another\n    caching class, so long as it provides `get` and `set` methods.\n\n    Added v0.2.0.\n\n- `key_cb`\n\n    is used to provide a custom key-generation function.  If\n    none is specified, then [Object::Signature](https://metacpan.org/pod/Object::Signature) is used.\n\n    The function should expect a single argument with an array reference\n    corresponding to the original method call parameters:\n\n    ```perl\n    $key_cb-\u003e( [ $self, @_ ] );\n    ```\n\n- `prefix`\n\n    This is the prefix too prepend to the key. It defaults to the class\n    and method name when the [\"cache\"](#cache) is specified, or an empty string\n    otherwise.\n\n    Added v0.2.0.\n\nRemaining `%options` are passed to the constructor for\n[Cache::FastMmap](https://metacpan.org/pod/Cache::FastMmap).\n\nAs of v0.3.0, you can import the `cache` method with a different\nnamme:\n\n```perl\nuse Class::Method::Cache::FastMmap\n   \"cache\" =\u003e { -as =\u003e \"memoize\" };\n\nsub my_method {\n  ...\n}\n\nmemoize 'my_method' =\u003e (\n   serializer  =\u003e 'storable',\n   expire_time =\u003e '1h',\n);\n```\n\nUndefined results are not cached. So if your method returns `undef`\non failure, then it never cache that result.\n\n# SEE ALSO\n\n[Cache::FastMmap](https://metacpan.org/pod/Cache::FastMmap)\n\n[Object::Signature](https://metacpan.org/pod/Object::Signature)\n\n# SOURCE\n\nThe development version is on github at [https://github.com/robrwo/Class-Method-Cache-FastMmap](https://github.com/robrwo/Class-Method-Cache-FastMmap)\nand may be cloned from [git://github.com/robrwo/Class-Method-Cache-FastMmap.git](git://github.com/robrwo/Class-Method-Cache-FastMmap.git)\n\n# BUGS\n\nPlease report any bugs or feature requests on the bugtracker website\n[https://github.com/robrwo/Class-Method-Cache-FastMmap/issues](https://github.com/robrwo/Class-Method-Cache-FastMmap/issues)\n\nWhen submitting a bug or request, please include a test-file or a\npatch to an existing test-file that illustrates the bug or desired\nfeature.\n\n# AUTHOR\n\nRobert Rothenberg \u003crrwo@cpan.org\u003e\n\nSome development of this module was sponsored by Science Photo Library\n[https://www.sciencephoto.com](https://www.sciencephoto.com).\n\n# COPYRIGHT AND LICENSE\n\nThis software is Copyright (c) 2018 by Robert Rothenberg.\n\nThis is free software, licensed under:\n\n```\nThe Artistic License 2.0 (GPL Compatible)\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fclass-method-cache-fastmmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobrwo%2Fclass-method-cache-fastmmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobrwo%2Fclass-method-cache-fastmmap/lists"}