-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Description of the feature
At the moment it is not possible to create operations you want to repeat in the protocols.
This could be handy for implementing set_cookies option to be able to set multiple cookie on the printing session.
Example:
defmodule MyApp.ProtocolExample do
steps do
for_options :set_cookies, ext: :acc do
call(:set_cookie, "Network.setCookie", &Map.fetch!(&1, :set_cookies_acc), %{httpOnly: true})
await_response(:cookie_set, [])
end
end
Implementation consideration
To be able to implement such a feature I am questioning myself on the following points:
- Why steps are done through macros and not functions? While they are converted to function calls at the end
- For the accumulator shall we save it inside the state? And if yes is there some standard to name keys (in the example I put it as
:set_cookies_accas the concatenation onset_cookiesandaccas the extension.)
Also for the moment all the protocols system is not documented. Will it be part of a next iteration? (I am thinking it could be nice to make it part of a separated library)
Metadata
Metadata
Assignees
Labels
No labels