rework arcana-base-server #39

Open
opened 2026-01-15 20:29:30 +00:00 by soyouzpanda · 0 comments
Owner

I think the implementation that I originally write for arcana-base-server is bad for various of reasons (readability and hard adaptability for instance).

where
TH: Clone,
TH: TryFrom<Url, Error = String>,
TH: Send,
TH: Display,
TH: 'static,
AT: async_fn_traits::AsyncFnOnce3<
TH,
mpsc::Sender<Result<ApplyResponse, Status>>,
ApplyRequest,
Output = IoResult<()>,
>,
AT: Send,
AT: Sync,
AT: Copy,
AT: 'static,
BT: async_fn_traits::AsyncFnOnce3<
TH,
mpsc::Sender<Result<BuildResponse, Status>>,
BuildRequest,
Output = IoResult<()>,
>,
BT: Send,
BT: Sync,
BT: Copy,
BT: 'static,
CT: async_fn_traits::AsyncFnOnce3<
TH,
mpsc::Sender<Result<CopyClosureResponse, Status>>,
CopyClosureRequest,
Output = IoResult<()>,
>,
CT: Send,
CT: Sync,
CT: Copy,
CT: 'static,
{
apply_function: AT,
build_function: BT,
copy_closure_function: CT,
targets: Arc<Mutex<HashMap<Id, TH>>>,
}

should be rewrite as a trait instead, as for my last test, I was successfully able to put async functions inside traits (I think that last time I checked it wasn't possible).

pub fn new(apply_function: AT, build_function: BT, copy_closure_function: CT) -> Self {

should be adapted to allow retro-compatibility with existing aracana servers.

Also we should find an alternative for mpsc::Sender as it makes server harder to implement.

I think the implementation that I originally write for `arcana-base-server` is bad for various of reasons (readability and hard adaptability for instance). https://git.afnix.fr/arcana/arcana/src/commit/bb6ffc0ee854b5690ed80a06d75302058cc2daa5/arcana-base-server/src/service.rs#L55-L96 should be rewrite as a trait instead, as for my last test, I was successfully able to put async functions inside traits (I think that last time I checked it wasn't possible). https://git.afnix.fr/arcana/arcana/src/commit/bb6ffc0ee854b5690ed80a06d75302058cc2daa5/arcana-base-server/src/service.rs#L136 should be adapted to allow retro-compatibility with existing aracana servers. Also we should find an alternative for mpsc::Sender as it makes server harder to implement.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
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
arcana/arcana#39
No description provided.