-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
hallo Mark, I am hanving a look at the http-api branch
which looks nice and wanted to probe
the soundness of the following approach :-)
Would it make sense to let the specific behaviour module change
it's own state on external calls? Smth like:
% scheduler.erl
- callback handle_call( Request :: any(), From :: {tag(), pid()}, State :: any() )
-> {ReplyType :: atom(), Reply :: any(), State :: any()}
handle_call(Request, From, State) ->
{Handler, HandlerState} = get_handler(State),
{reply, Reply, HandlerState} = apply(Handler, handle_call, [Request, From, HandlerState]),
State = record_update(State, HandlerState),
{reply, Reply, State}.This could allow e.g. to enqueue Tasks into the behaviour state,
to be scheduled in the offers callback
Also, not sure if a reply or a noreply would fit better here.
is btw the http-api branch being developed further?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels