walk the tree at request time #8

Closed
opened 2022-07-02 10:31:34 +00:00 by xananax · 1 comment
Collaborator

Currently, the server reads all files in a given directory prior to opening the port, in _start_server. It then creates a bound endpoint for each file there. This is good for performance, if this was a production server, but in case of file changes (file added, removed, renamed), changes will not be reflected, and it will lead to unexpected behavior for users.

Potential mitigations, in my preferred order:

  1. have the server accept a single method; allow the implementation to remain entirely in userland. then, in userland, do point 2 below.
  2. have the server accept a string match instead of a string for endpoints. If a string contains ? or *, match it instead of using has(). Potentially also accept regexes (or only regexes?). That means the lookup becomes O(n) instead of O(1) of course.
  3. watch the directory for changes, refresh file list on change. Caveats: don't know how easy that is in Godot. Watching files in a cross platform way is usually tricky
Currently, the server reads all files in a given directory prior to opening the port, in `_start_server`. It then creates a bound endpoint for each file there. This is good for performance, if this was a production server, but in case of file changes (file added, removed, renamed), changes will not be reflected, and it will lead to unexpected behavior for users. Potential mitigations, in my preferred order: 1. have the server accept a single method; allow the implementation to remain entirely in userland. then, in userland, do point 2 below. 2. have the server accept a string match instead of a string for endpoints. If a string contains `?` or `*`, match it instead of using `has()`. Potentially also accept regexes (or only regexes?). That means the lookup becomes O(n) instead of O(1) of course. 3. watch the directory for changes, refresh file list on change. Caveats: don't know how easy that is in Godot. Watching files in a cross platform way is usually tricky
xananax added the
enhancement
label 2022-07-02 10:31:34 +00:00
Owner

closed by #9

closed by #9
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: yagich/tickle-godot-frontend#8
No description provided.