--- Title: AsyncMap alwaysopen: false categories: - docs - operate - stack description: Asynchronously maps records one-to-one. linkTitle: asyncMap weight: 50 --- ```java public GearsBuilder asyncMap​( gears.operations.AsyncMapOperation mapper) ``` The `asyncMap` function allows you to use a [`GearsFuture`]({{< relref "/operate/oss_and_stack/stack-with-enterprise/gears-v1/jvm/classes/gearsfuture" >}}) object to asynchronously map each input record in the pipe to an output record, one-to-one. ## Parameters Type parameters: | Name | Description | |------|-------------| | I | The template type of the returned builder | Function parameters: | Name | Type | Description | |------|------|-------------| | mapper | AsyncMapOperation | For each input record, returns a new output record | ## Returns Returns a GearsBuilder object with a new template type. ## Example ```java GearsBuilder.CreateGearsBuilder(reader). asyncMap(r->{ GearsFuture f = new GearsFuture(); new Thread(new Runnable() { @Override public void run() { try { Thread.sleep(1); f.setResult("done"); } catch (Exception e) { e.printStackTrace(); } } }).start(); return f; }); ```