# Is the callbacks example correct in &quot;Q for Mortals&quot;?

**URL:** <https://forum.kx.com/t/is-the-callbacks-example-correct-in-quot-q-for-mortals-quot/11995>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [February 26, 2020, 8:41pm UTC](https://forum.kx.com/t/is-the-callbacks-example-correct-in-quot-q-for-mortals-quot/11995 "2020-02-26T20:41:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmitri14](https://avatars.discourse-cdn.com/v4/letter/d/dc4da7/32.png) [@dmitri14](https://forum.kx.com/u/dmitri14)\
**Post date:** [February 26, 2020, 8:41pm UTC](https://forum.kx.com/t/is-the-callbacks-example-correct-in-quot-q-for-mortals-quot/11995/1 "2020-02-26T20:41:00Z")

</div>

Trying this example:  
https://code.kx.com/q4m3/1\_Q\_Shock\_and\_Awe/#120-example-asynchronous-callbacks  
On server:

```
rsvp:{[arg;cb] show arg; (neg .z.w) (cb; 43); show `done;}

```

On client:

```
(neg h) (`rsvp; 42; `echo)

```

The server displays `42` as advertised, but the client responds with `'echo`, no `43` shows up.

Anything wrong with the example? Any way to fix it?

---

<div class="post-metadata">

**Author:** ![jsawyer](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jsawyer](https://forum.kx.com/u/jsawyer)\
**Post date:** [February 26, 2020, 9:00pm UTC](https://forum.kx.com/t/is-the-callbacks-example-correct-in-quot-q-for-mortals-quot/11995/2 "2020-02-26T21:00:00Z")

</div>

Dmitri,

You are seeing this error because you did not define the “echo” function on the client side.

> We turn to the client side and create echo to serve as the function called back for this demonstration.
> 
> q)echo:{show x} / on client

`q)h:hopen 10223q)neg[h] (`rsvp;42;`echo)q)'echoq)echo:{show x} / on clientq)neg[h] (`rsvp;42;`echo)q)43`

Regards,  
Jorge

---

<div class="post-metadata">

**Author:** ![zaitsev](https://avatars.discourse-cdn.com/v4/letter/z/53a042/32.png) [@zaitsev](https://forum.kx.com/u/zaitsev)\
**Post date:** [February 26, 2020, 9:40pm UTC](https://forum.kx.com/t/is-the-callbacks-example-correct-in-quot-q-for-mortals-quot/11995/3 "2020-02-26T21:40:00Z")

</div>

Thank you for the catch, Jorge!

The same section defines `echo also on the server,

it would have been less confusing to have a different name.

How comes, no error was reported when `echo is not defined?
