{
  "id": "setresult",
  "title": "SetResult",
  "url": "https://redis.io/docs/latest/operate/oss_and_stack/stack-with-enterprise/deprecated-features/gears-v1/jvm/classes/gearsfuture/setresult/",
  "summary": "Sets a computation to run asynchronously.",
  "tags": [
    "docs",
    "operate",
    "stack"
  ],
  "last_updated": "2026-04-22T11:55:45+02:00",
  "page_type": "content",
  "content_hash": "0b33d1f063cef66d018ab94963c30381aa3d96e021055b73a113f4a251cb6d65",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "[code example]\n\nSets a computation to run asynchronously."
    },
    {
      "id": "parameters",
      "title": "Parameters",
      "role": "parameters",
      "text": "| Name | Type | Description |\n|------|------|-------------|\n| result | template type I | The result of a computation |"
    },
    {
      "id": "returns",
      "title": "Returns",
      "role": "returns",
      "text": "None"
    },
    {
      "id": "example",
      "title": "Example",
      "role": "example",
      "text": "[code example]"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "java",
      "code": "public void setResult​(I result) \n\tthrows java.lang.Exception",
      "section_id": "overview"
    },
    {
      "id": "example-ex0",
      "language": "java",
      "code": "GearsBuilder.CreateGearsBuilder(reader).map(r->r.getKey()).\n\tasyncFilter(r->{\n\t\tGearsFuture<Boolean> f = new GearsFuture<Boolean>();\n\t\ttry {\n\t\t\tf.setResult(r.equals(\"x\"));\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\t\t\t\n\t\treturn f;\n});",
      "section_id": "example"
    }
  ]
}
