by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 03 10:05

    dependabot-preview[bot] on pip

    (compare)

  • Aug 03 10:05
    dependabot-preview[bot] closed #109
  • Aug 03 10:05
    dependabot-preview[bot] labeled #121
  • Aug 03 10:05
    dependabot-preview[bot] opened #121
  • Aug 03 10:05

    dependabot-preview[bot] on pip

    Bump pytest from 5.3.5 to 6.0.1… (compare)

  • Aug 03 09:56

    dependabot-preview[bot] on pip

    (compare)

  • Aug 03 09:56
    dependabot-preview[bot] closed #119
  • Aug 03 09:56
    dependabot-preview[bot] labeled #120
  • Aug 03 09:56
    dependabot-preview[bot] opened #120
  • Aug 03 09:56

    dependabot-preview[bot] on pip

    Bump sentry-sdk from 0.14.1 to … (compare)

  • Aug 03 08:59

    touilleMan on v0.50.0

    (compare)

  • Aug 03 08:58

    touilleMan on v0.5.0

    (compare)

  • Aug 03 08:20

    touilleMan on v0.50.0

    (compare)

  • Aug 03 08:19

    touilleMan on master

    Bump version 0.4.0 -> 0.5.0 (compare)

  • Aug 03 08:08
    touilleMan closed #6
  • Aug 03 08:08
    touilleMan closed #8
  • Aug 03 08:07

    touilleMan on master

    Add proxy for prepared statemen… Fix formatting Improve style in tests and 5 more (compare)

  • Aug 03 08:07
    touilleMan closed #9
  • Aug 03 07:45
    dependabot-preview[bot] labeled #1680
  • Aug 03 07:45

    dependabot-preview[bot] on pip

    Bump ipython from 7.16.1 to 7.1… (compare)

Alex Grönholm
@agronholm
this shouldn't take that much of your time, and I don't know anyone better to ask
for the rest of the upcoming PR series, I can have other people review them
I don't want to impose, so if you feel this is awkward for you or you don't have the time or energy, that's fine too
Nathaniel J. Smith
@njsmith
@agronholm I'm heading to bed, but send me the links and I'll try to take a look?
Alex Grönholm
@agronholm
Quentin Pradet
@pquentin
(it probably would have been easier to review if split in commits)
Royce Mitchell
@remdragon
@njsmith I've mocked up my first attempt at the message loop, would you be interested in looking at it?
Royce Mitchell
@remdragon
@njsmith it may not be shorter, but I think it definitely is less invasive on win32 application structure: https://gist.github.com/remdragon/6dd5c70455ff6f499336f4f192dec36b
Alex Grönholm
@agronholm
@pquentin I've already split my changes into meaningful units
I don't see how splitting those further into several commits makes it easier to review
at least I just look at the changed files as a whole
Alex Grönholm
@agronholm
I'm wondering why trio.socket.SocketType is a dummy class
it's a PITA when trying to make it work with static typing
richardsheridan
@richardsheridan
@remdragon event_loop never awaits anything from trio, won't it will block the trio guest event loop?
Mattia
@nocturn9x
@njsmith I have a question. In trio, both tasks that are spawned trough a nursery and awaited coroutines are cancellable. How do you achieve that? I guess that tasks that are spawned have a specific flag (like spawned=True) but how do you get coroutines that are called with the await syntax into task objects?
Royce Mitchell
@remdragon
@richardsheridan the way I understand guest mode it doesn't need to. trio will call run_sync_soon_threadsafe() with a callable when it needs attention. and the callable provided to that function doesn't need to be awaited. From what I can tell this complies with trio's guest mode, but I haven't tried it yet
I think trio probably does some task switching magic when it gets those callbacks
Royce Mitchell
@remdragon
I just tweaked it to remove the GetMessage(). After thinking about it, I don't think it's necessary, should make the whole thing use fewer cpu cycles.
Royce Mitchell
@remdragon
We could also make a simpler version that just returns a MSG object once one has been received. That way the function would act like a drop-in replacement for GetMessage() itself and app developers can still use their own win32 event loop logic. I think I could also emulate PeekMessage... hmm..
András Mózes
@mozesa
Hello, could you help me. Could be any drawback of using AsyncExitStack with Nursery?
I mean could something go wrong because of using AsyncExitStack with Nursery. I don't know how fragile nurseries are. :smile:
Matthias Urlichs
@smurfix
@mozesa I'm using that combination in a couple places. No problems so far.
András Mózes
@mozesa
@smurfix Good to hear that. Thanks!
Joshua Oreman
@oremanj
@mozesa It’s fine as long as you use the AsyncExitStack in a way that matches something you could theoretically do with a series of async with statements. But AsyncExitStack combined with async with statements allows you to express other patterns too, and some of those won’t work, like “enter nursery 1, enter nursery 2, leave nursery 1, leave nursery 2” in that order.
András Mózes
@mozesa
@oremanj :thumbsup: Great thanks
Joshua Oreman
@oremanj
@nocturn9x await doesn’t create a new task — it’s just a function call. It is not actually even possible for Trio to do something on every await, just like you can’t make Python do something on every function call. One task is associated with the entire async callstack, starting with the thing that was spawned using nursery.start_soon or trio.run and ending with the Trio primitive that it’s currently waiting on. (At the lowest level, almost all Trio programs use only two such primitives: wait_task_rescheduled and cancel_shielded_checkpoint. There’s one more used only in rather obscure cases. See trio/_core/_traps.py.)
Kyle Altendorf
@altendky
last time i looked i didn't find the origin of the name trio, but i thought at some point i saw it... where am i supposed to be looking?
Joshua Oreman
@oremanj
@altendky I think the practical reason is “it was short, available, pronounceable, and ended in -io” but there are a number of alternative explanations
one: it arranges your tasks in a tree-oh
two: it’s based on three fundamental concepts: async functions, cancel scopes, and nurseries
IIRC in the very earliest stages of development (pre 0.1.0) it was called “oratorio”
Nathaniel J. Smith
@njsmith
also I liked the image of multi-person music as an example of concurrency
but yeah it's just a name, there's no deep meaning
(iirc the name actually predates the discovery of nurseries, so the "alternative explanations" really are just happy accidents)
Kyle Altendorf
@altendky
thanks both. so the X here is that qtrio is still 'just a name' to me rather than something i particularly like :] and i'm indulging since i think i'm close to a first release. triq was offered up by one of the existing qt/trio projects. quattro is available. quartet is namesquatted from 2017 so kinda available, sorta. it seems like there's value to both 'relating' to the name trio and also being different by more than just an extra q. and from two: above i could see 'widgets' being a fourth thing. i'm stuck between 'meh' and 'stop bikeshedding'.
Royce Mitchell
@remdragon
qtrio is kinda cool because it's a portmanteau, if you're into that sorta thing
Quentin Pradet
@pquentin
+1 for qtrio, obvious, and contains both Qt and Trio as mentioned by @remdragon
goodboy
@goodboy
yeah i called my internal entry point qtrio originally
now it's qtractor lel
Kyle Altendorf
@altendky
welp, there's the first release https://qtrio.readthedocs.io/ of course thanks to the trio team both for the help getting this far and for providing guest mode etc to allow this to happen now.
András Mózes
@mozesa
@altendky Awesome :fireworks:
Royce Mitchell
@remdragon
@agronholm I feel like my smtp protocol is in pretty good shape now, wouldn't mind your feedback if you don't mind looking at it.
matrixbot
@matrixbot
decentral1se nice work on qtrio!
decentral1se \o/
Mattia
@nocturn9x
@oremanj thanks! I don't even know why I was thinking about that so much, lol
Still no interested contributors? haha
András Mózes
@mozesa

Hello, I am facing a problem hope you will help me out. :)

I use a device which has its own event loop which runs only during YAPI.Sleep().
I don't know whether I need the brand-new guest mode or not, but what I would like is to be able to check whether there is a live cancellation in the context from where function was called previously.

And if there is a live cancellation I simply break the loop running in thread. I know there is a cancellable=True flag but I don't want to let threads run silently.

Thanks for your help in advance.

    async def async_main():
        register_usb_hub()

        def trampoline():
            errmsg = YRefParam()
            while True:
                YAPI.Sleep(1_000, errmsg=errmsg)
                print(trio.from_thread.run_sync(trio.current_effective_deadline))

        with trio.move_on_after(5.0):
            await trio.to_thread.run_sync(trampoline, cancellable=False)

    trio.run(async_main)
richardsheridan
@richardsheridan
@mozesa I got this recipe for cancelling threads from someone in this channel a while ago (maybe @oremanj ?) and i've been pretty happy with it.
you must call it frequently though, so instead of YAPI.Sleep(1_000) use `YAPI.Sleep(100) or whatever you can afford
NoskLo
@nosklo_gitlab
if your YAPI thing has a threadsafe way to schedule a function to be called soon, you can use guest mode instead