You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scenes - abstraction on normal states. It helps hand over on repetitive actions to module control.
What scenes will do
Start scene on trigger
Gives possiblity to easy change steps.
Start sub scene (maybe it don't in release)
Execute scene in one command from code
Save data between steps
Data flow between scenes
Topic 0. Goals
I want to make mechanism that helps convert scenes to more declarative code.
Why? Maybe it helps write less repeatable code. But then public API will more complex.
Need to find balance
Actions
Entrypoints
Entrypoints must filter (endpoint and/or filters) and may be send some information on fails.
It will "generated" handlers.
Stop points
This points, just stops scene. No actions.
Events callbacks
Avaliable callbacks: OnStart, OnFinish, OnStop.
Callbacks OnStart and OnStop will calls after handler-points.
Steps - Enter
Steps can do some work when user moving to this step. It can'be information for excepted data or something like that.
It need for don't do this in previous step. Like that
step_1() {
do_smth()
send("Enter your name")
next_step()
}
These callbacks can'be disabled in changing step command.
Topic 1. Interface
I tried to write my vision of public API but it gets wordy and hard to read.
I think need look towards option-func or inner callbacks.
Topic 2. Data storage
It pretty then you have easy access to data.
Now supports generic and it can help. Scene can work with pre-declarated type of data. May be data-storage will separated from state storage.
But it also make API ugly.
Topic 3. Sub scenes.
Sub scenes will only runtime feature. I don't known that write here...
Topic 4. History
For error handling and debugging make sense do mechanism for tracing user actions.
It will be collect all errors, steps moves.
Scenes will communicate via errors. For example, if user make bad action it's error and scene can stops with error, that can'be have sense only in logs.
How I'm sees logs:
Scene: MyScene
Start:
EntryPoint: /scene
Stop: unexpected error from step 'check_name': db: connection refused
Traceback:
[0]: EntryPoint: /scene
Update: {json of telegram update}
[1]: Step: accept_tos
Update: ...
[2]: Step: enter name
Update: ...
Repeat-Step: "invalid format of name"
[2]: Step: enter name
Error:
Unexpected: "db: connection-refused"
Action: Stop-Scene
[OnStop]: Make: ResetData
The text was updated successfully, but these errors were encountered:
Scenes - abstraction on normal states. It helps hand over on repetitive actions to module control.
What scenes will do
Topic 0. Goals
I want to make mechanism that helps convert scenes to more declarative code.
Why? Maybe it helps write less repeatable code. But then public API will more complex.
Need to find balance
Actions
Entrypoints
Entrypoints must filter (endpoint and/or filters) and may be send some information on fails.
It will "generated" handlers.
Stop points
This points, just stops scene. No actions.
Events callbacks
Avaliable callbacks: OnStart, OnFinish, OnStop.
Callbacks OnStart and OnStop will calls after handler-points.
Steps - Enter
Steps can do some work when user moving to this step. It can'be information for excepted data or something like that.
It need for don't do this in previous step. Like that
These callbacks can'be disabled in changing step command.
Topic 1. Interface
I tried to write my vision of public API but it gets wordy and hard to read.
I think need look towards option-func or inner callbacks.
Topic 2. Data storage
It pretty then you have easy access to data.
Now supports generic and it can help. Scene can work with pre-declarated type of data. May be data-storage will separated from state storage.
But it also make API ugly.
Topic 3. Sub scenes.
Sub scenes will only runtime feature. I don't known that write here...
Topic 4. History
For error handling and debugging make sense do mechanism for tracing user actions.
It will be collect all errors, steps moves.
Scenes will communicate via errors. For example, if user make bad action it's error and scene can stops with error, that can'be have sense only in logs.
How I'm sees logs:
The text was updated successfully, but these errors were encountered: