Skip to content

Commit a1ea40a

Browse files
authored
docs: Update add-function.md to fix example (#6673)
When performing the changes described in add-function.md for adding a host-price-of function to xapi, a type error would arise from the message-forwarding.ml file - this is fixed by explicitly giving the remote_fn named argument.
2 parents 8bb4635 + 0980515 commit a1ea40a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/content/xapi/guides/howtos/add-function.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ the Host module:
172172
let price_of ~__context ~host ~item =
173173
info "Host.price_of for item %s" item;
174174
let local_fn = Local.Host.price_of ~host ~item in
175-
do_op_on ~local_fn ~__context ~host
176-
(fun session_id rpc -> Client.Host.price_of ~rpc ~session_id ~host ~item)
175+
let remote_fn = Client.Host.price_of ~host ~item in
176+
do_op_on ~local_fn ~__context ~host ~remote_fn
177177

178178
After the ~__context parameter, the parameters of this new function should
179179
match the parameters we specified for the message. In this case, that is the

0 commit comments

Comments
 (0)