a2svior
MModular
•Created by a2svior on 7/15/2024 in #questions
SSL/TLS Support?
Is there anything planned for Mojo stdlib in terms of SSL/TLS? I'm thinking something like Golang's crypto/tls or Python's SSL socket wrapper
We want to add HTTPS support to Lightbug but for that would be good to know if the stdlib will include this functionality any time soon or if this has to be built by the community
42 replies
MModular
•Created by a2svior on 5/11/2024 in #questions
Passing a trait as a parameter to `Dict`?
This is related to a proposal for adding Middleware functionality to Lightbug HTTP: https://github.com/saviorand/lightbug_http/pull/33#issuecomment-2105547981
We're trying to do something like the following:
Where
routes: Dict[String, HTTPHandler]
takes in an HTTPHandler
trait which can be implemented by different handlers, including ones created by the user.
Currently, since Dict
expects a value that implements CollectionElement
, so we're getting the following error:
This persists even if HTTPHandler
extends CollectionElement
like so:
trait HTTPHandler(CollectionElement)
.
Any ideas on how we can get this to work?4 replies
MModular
•Created by a2svior on 4/5/2024 in #questions
Async function docs?
Hi! I found a mention of
async fn
and async def
in the roadmap document, but no description of how these actually work? Does Mojo support any sort of async/await workflow?
The only mention of async I see is in the changelog and just a tiny bit in the code of the coroutine in the standard library. Can we have better documentation for this?5 replies
MModular
•Created by a2svior on 1/3/2024 in #questions
Are coroutines executed in parallel?
I'm trying this example:
call_em_together() and call_em_coroutine() both print roughly 4 seconds as the result. call_em_parallel() prints roughly 2 seconds. Does that mean coroutines are not executed in parallel? Is there a way to execute them in parallel, like with goroutines in Go?
I saw a TaskGroup mentioned in the changelog but no documentation for it exists yet, and I'm not sure how to import it.
My use case is to have a blocking process/an infinite loop (e.g. a server listener) running on one coroutine , and another processes (e.g. a client making requests) executing in another in parallel
4 replies