{"id":13808123,"url":"https://github.com/juanavelez/vertx-util","last_synced_at":"2026-02-06T06:02:47.637Z","repository":{"id":57718175,"uuid":"88551180","full_name":"juanavelez/vertx-util","owner":"juanavelez","description":" Collection of Vert.x utility methods","archived":false,"fork":false,"pushed_at":"2018-05-13T01:33:57.000Z","size":43,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T16:36:44.947Z","etag":null,"topics":["reactive","vertx"],"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/juanavelez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-04-17T21:12:35.000Z","updated_at":"2018-07-10T03:40:57.000Z","dependencies_parsed_at":"2022-09-14T22:55:17.889Z","dependency_job_id":null,"html_url":"https://github.com/juanavelez/vertx-util","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanavelez%2Fvertx-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanavelez%2Fvertx-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanavelez%2Fvertx-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/juanavelez%2Fvertx-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/juanavelez","download_url":"https://codeload.github.com/juanavelez/vertx-util/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240466797,"owners_count":19805862,"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":["reactive","vertx"],"created_at":"2024-08-04T01:01:35.608Z","updated_at":"2026-02-06T06:02:47.630Z","avatar_url":"https://github.com/juanavelez.png","language":"Java","funding_links":[],"categories":["Utilities"],"sub_categories":[],"readme":"# Vert.x-Util\n\n[![Build Status](https://travis-ci.org/juanavelez/vertx-util.svg?branch=master)](https://travis-ci.org/juanavelez/vertx-util)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.chibchasoft/vertx-util/badge.svg)](https://search.maven.org/#search%7Cga%7C1%7Ccom.chibchasoft.vertx-util)\n[![codecov](https://codecov.io/gh/juanavelez/vertx-util/branch/master/graph/badge.svg)](https://codecov.io/gh/juanavelez/vertx-util)\n\nA Collection of miscellaneous Vert.x-related methods\n\n## Dependencies\n\nVert.x-Util requires Vert.x-Core version 3.4.1 or up.\n\n## Classes\n\n### com.chibchasoft.vertx.util.VertxUtil\n\nA collection of utility methods related to Vert.x\n\n#### VertxUtil.executeBlocking(identifier, blockingCodeHandler, resultHandler)\n\nThis method is similar to the existing `Context.executeBlocking(blockingCodeHandler, resultHandler)` but differs \nin that allows the blocking code handler to be assigned to (and executed by) a\n\u003ca href=\"https://github.com/eclipse/vert.x/blob/master/src/main/java/io/vertx/core/impl/TaskQueue.java\"\u003eTaskQueue\u003c/a\u003e\nassociated to the provided identifier (and current `Context`). A `TaskQueue` is created if it is not already mapped\nto the provided identifier (and `Context`), otherwise the existing `TaskqQueue` is used. The `TaskQueue` utilizes\nthe same `Executor` associated to the current `Context` (which comes from the `WorkerPool` assigned to the `Context`).\nThe mapping of `Context`s and identifiers to `TaskQueue`s is done via a weak hash map, which does not prevent the\nidentifiers as well as the `TaskQueue`s from being Garbage Collected.\n\nCalling this method more than once for the same identifier (and current `Context`), effectively results in the\nblocking code handler being executed sequentially with other previous blocking code handlers for the same identifier \n(and current `Context`) as it would normally happen with `Context.executeBlocking(blockingCodeHandler, true,\nresultHandler)`). There are no ordering guarantees, however, in relation to the execution of other blocking code \nhandlers associated to different identifiers or even the same identifier but under a different `Context`.\n\n**NOTES:** \n\n* This method needs to be called within the scope of an existing Vert.x `Context`.\n* This method makes use of a Vertx internal API method: `ContextInternal.executeBlocking(Handler, TaskQueue, Handler)`\n\n#### VertxUtil.executeBlocking(context, identifier, blockingCodeHandler, resultHandler)\n\nSimilar to `VertxUtil.executeBlocking(identifier, blockingCodeHandler, resultHandler)` but using the provided context.\n\n### com.chibchasoft.vertx.util.concurrent.ContextExecutorService\n\nImplementation of `ExecutorService` that relies on a Vert.x `Context` for the execution of submitted tasks.\nSubmit methods for `ContextExecutorService` return `ContextFuture` instances.`ContextFuture` is both a `RunnableFuture`\nand a Vert.x `Future`. `ContextFuture` implements the code of both `FutureTask` and Vert.x `FutureImpl`.\nAs submitted tasks are executed within the scope of a `Context`, a normal `FutureTask.get()` would be ill-advised\nas it would block the `Context` as well as preventing the actual task of being executed (in the case of an\nEvent Loop Context). \n\nIn this case the correct way of usage for the `ContextFuture` would be to use the provided Vert.x `Future` methods\n(setHandler, succeeded, failed, etc.).\n\n**NOTES:**\n\n* It is not recommended to call cancel(true) as it is not clearly defined how the underlying Context would react to\nbeing interrupted.\n* It is only recommended to use `ContextExecutorService` as the `ExecutorService` for a Client library as long as\nthe Client Library does not take ownership of the returned `ContextFuture`, this is, the Client Library should\nreturn the `ContextFuture` for the caller to own as thus avoiding the usage of `RunnableFuture` methods\n(`get()` and `get(long, TimeUnit)`) that would block the Context. \n\n**Clarification**\n\nI am not well versed in the usage of software licenses so I did my best effort in trying to comply with the licensing\nrequirements of both `java.util.concurrent.FutureTask` and `io.vertx.core.impl.FutureImpl`on which `ContextFuture`\nis heavily based (mostly verbatim in the case of the `FutureTask` methods). You will notice that\n`ContextFuture` source class file includes three licenses: Oracle/Sun's (`FutureTask`), Eclipse's(`FutureImpl`) and\nApache's (My own changes). If you think that I am doing something wrong (license-wise) please let me know\n(*jvelez@chibchasoft.com*).\n \n## Maven ##\n\nVert.x-Util is published to the\n[maven public repo](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.chibchasoft%22%20AND%20a%3A%22vertx-util%22).\n\nAdd the vertx-util dependency to your project, in case of maven like this:\n\n```xml\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.chibchasoft\u003c/groupId\u003e\n            \u003cartifactId\u003evertx-util\u003c/artifactId\u003e\n            \u003cversion\u003eVERSION\u003c/version\u003e\n        \u003c/dependency\u003e\n```\n\nwhere the latest released VERSION is [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.chibchasoft/vertx-util/badge.svg)](https://search.maven.org/#search%7Cga%7C1%7Ccom.chibchasoft.vertx-util)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanavelez%2Fvertx-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuanavelez%2Fvertx-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuanavelez%2Fvertx-util/lists"}