-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handsome refactoring and upgrades (I am going to kill god) #3
Conversation
Another TODO is that no meme? is not concurrency safe, one call can preempt another and the wrong or worse, a corrupted image may be sent. Which would be incredibly funny, though |
Yes, so far the development of this project has been focusing on functionality over correctness, but tissues like this are to be considered in the future. |
It is an easy fix |
|
LGTM! Let's kill god! |
Gentlemen, there is a couple of TODOs, but I still want to show you this cock.
This essentially rewrites testauskameli in such away, that you can reasonably easily add backends (shit like language playgrounds, latex, no meme?) and such that you can also somewhat easily add frontends (Discord, cli, http, whatever)
To create a backend:
MrSnippet
on it (named so in honor of Luukasa)To create a frontend:
MrSnippet
trait objects, such that it is valid in an async, Send + Sync, interior mutability contextExecutor
on said structureTo run the executor then, you just need to spawn a tokio::task that awaits the future from
Executor::run
.You then send it inputs via a
flume
channel (in async mode, or youre mom gay), and with theContext
type that you need to set for the executor trait, the executor will send the response messages automatically.This is a WIP, here is a couple outstanding issues that I know of:
The async command can also automatically create temporary directories and files to run the code in. The run methods which use any of the temporary IO return a FIles object along with a future in a tuple.
The Future is the actual command, awaiting it will run it.
The Files is a guard for the temporary files, once it's dropped, da files are gone