{"id":13775681,"url":"https://github.com/LMAX-Exchange/disruptor-proxy","last_synced_at":"2025-05-11T08:32:59.002Z","repository":{"id":6337061,"uuid":"7572784","full_name":"LMAX-Exchange/disruptor-proxy","owner":"LMAX-Exchange","description":"Byte-code generator to create Disruptor-backed proxies","archived":false,"fork":false,"pushed_at":"2024-10-16T11:45:44.000Z","size":1832,"stargazers_count":95,"open_issues_count":0,"forks_count":36,"subscribers_count":33,"default_branch":"master","last_synced_at":"2024-11-14T12:53:09.510Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LMAX-Exchange.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-12T07:18:34.000Z","updated_at":"2024-10-16T11:45:11.000Z","dependencies_parsed_at":"2024-11-14T12:40:20.631Z","dependency_job_id":"a96bdcd8-6bb4-4410-a5ae-d57f4cad0b30","html_url":"https://github.com/LMAX-Exchange/disruptor-proxy","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/LMAX-Exchange%2Fdisruptor-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMAX-Exchange%2Fdisruptor-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMAX-Exchange%2Fdisruptor-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LMAX-Exchange%2Fdisruptor-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LMAX-Exchange","download_url":"https://codeload.github.com/LMAX-Exchange/disruptor-proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225027498,"owners_count":17409447,"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-08-03T17:01:45.983Z","updated_at":"2024-11-17T10:31:50.976Z","avatar_url":"https://github.com/LMAX-Exchange.png","language":"Java","funding_links":[],"categories":["\u003ca id=\"6e80463404d46f0493cf6e84597e4b5c\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"e99ba5f3de02f68412b13ca718a0afb6\"\u003e\u003c/a\u003eTor\u0026\u0026\u0026Onion\u0026\u0026洋葱"],"readme":"# disruptor-proxy\n\n![Java CI with Gradle](https://github.com/LMAX-Exchange/disruptor-proxy/workflows/Java%20CI%20with%20Gradle/badge.svg)\n[![License](https://img.shields.io/github/license/LMAX-Exchange/disruptor-proxy)](https://github.com/LMAX-Exchange/disruptor-proxy/blob/master/LICENCE.txt)\n\nThe disruptor-proxy is a tool for creating thread-safe proxies to your existing business code.\n\nUtilising the power of the [Disruptor](https://github.com/LMAX-Exchange/disruptor),\ndisruptor-proxy will provide a high-performance, low-latency multi-threaded interface\nto your single-threaded components.\n\nThis in turn allows users to exploit the\n[single-writer principle](http://mechanical-sympathy.blogspot.co.uk/2011/09/single-writer-principle.html)\nfor maximum straight-line performance.\n\n![implementation diagram](https://raw.githubusercontent.com/LMAX-Exchange/disruptor-proxy/master/doc/DisruptorProxy.jpg)\n\n## Maintainer\n\n\nLMAX Development Team\n\n## Examples\n\n```java\n\n// Basic usage\n\nfinal RingBufferProxyGeneratorFactory generatorFactory = new RingBufferProxyGeneratorFactory();\n\nfinal T tImpl = new ConcreteT();\n\nfinal RingBufferProxyGenerator generator = generatorFactory.newProxy(GeneratorType.BYTECODE_GENERATION);\n\nfinal T proxy = generator.createRingBufferProxy(T.class, disruptor, OverflowStrategy.DROP, tImpl);\n\ndisruptor.start();\n```\n\n\n\n```java\n\n// Get notified of end-of-batch events\n\nfinal RingBufferProxyGeneratorFactory generatorFactory = new RingBufferProxyGeneratorFactory();\n\nfinal T tImpl = new ConcreteT();\nfinal BatchListener batchListener = (BatchListener) tImpl; // implement BatchListener in your component\n\nfinal RingBufferProxyGenerator generator = generatorFactory.newProxy(GeneratorType.BYTECODE_GENERATION);\n\nfinal T proxy = generator.createRingBufferProxy(T.class, disruptor, OverflowStrategy.DROP, tImpl);\n\ndisruptor.start();\n```\n\n\n\n```java\n\n// Get notified of buffer-overflow events\n\nfinal RingBufferProxyGeneratorFactory generatorFactory = new RingBufferProxyGeneratorFactory();\n\nfinal T tImpl = new ConcreteT();\nfinal DropListener dropListener = new MyDropListener(); // handle drop events\n\nfinal RingBufferProxyGenerator generator =\n        generatorFactory.newProxy(GeneratorType.BYTECODE_GENERATION,\n        new ConfigurableValidator(true, true),\n        dropListener);\n\nfinal T proxy = generator.createRingBufferProxy(T.class, disruptor, OverflowStrategy.DROP, tImpl);\n\ndisruptor.start();\n```\n\n\n## GeneratorType\n\n* `GeneratorType.JDK_REFLECTION` - uses `java.lang.reflect.Proxy` to generate a dynamic proxy that will add events to the RingBuffer. Use this for minimal dependencies.\n* `GeneratorType.BYTECODE_GENERATION` - uses Javassist to generate classes that will add events to the RingBuffer. Use this for maximum performance.\n\n\n## Dependencies\n\nMinimal dependency is the Disruptor JAR. \n\nIf you are using byte-code generation for the proxy class (specified by `GeneratorType`), you'll also need the Javassist JAR.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLMAX-Exchange%2Fdisruptor-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLMAX-Exchange%2Fdisruptor-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLMAX-Exchange%2Fdisruptor-proxy/lists"}