https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • c

    Crazy Rabbit

    05/03/2023, 2:35 PM
    dkim for sending emails
  • c

    Crazy Rabbit

    05/03/2023, 2:35 PM
    For a server it would consume too much resources for keys to be generated.
  • c

    Crazy Rabbit

    05/03/2023, 2:36 PM
    So I can generate them on client side and send them to the server
  • s

    SebastiaanYN

    05/03/2023, 2:36 PM
    you can generate keys using unbound
  • s

    SebastiaanYN

    05/03/2023, 2:36 PM
    bundled technically also works but you occasionally exceed time limits
  • s

    Skye

    05/03/2023, 2:36 PM
    There's not many details I can share, but you might find to be something cool coming soon™️ 👀
  • s

    Skye

    05/03/2023, 2:37 PM
    A DO should have access to all of the bindings that the parent worker does
  • s

    sathoro

    05/03/2023, 2:42 PM
    another dumb question, do I need to create a queue for each of my environments separately?
  • s

    Skye

    05/03/2023, 2:43 PM
    You could use the same one for each if you want, but I believe you need to put it in each
    [env.*]
    section, regardless of whether it's the same one or a new one
  • s

    sathoro

    05/03/2023, 2:50 PM
    I have an even dumber question
  • s

    sathoro

    05/03/2023, 2:51 PM
    in my first env I can use this
    Copy code
    [[queues.producers]]
      queue = "article-queue"
      binding = "ARTICLE_QUEUE"
    
    [[queues.consumers]]
      queue = "article-queue"
    but in my second env I have to use this syntax
    Copy code
    queues.producers = [
      { queue = "article-queue", binding = "ARTICLE_QUEUE" }
    ]
    
    queues.consumers = [
      { queue = "article-queue" }
    ]
    I don't understand this, I thought they are equivalent
  • s

    Skye

    05/03/2023, 3:04 PM
    Essentially toml is weird. Whenever you have [[something]], it makes a new table, and puts everything in it under that. If you want to put it under your env, you can use
    [[env.MY_ENV.queues.producers]]
    and you can have the same syntax as the first one
  • s

    Skye

    05/03/2023, 3:04 PM
    If you want something that makes more sense, you can chuck your wrangler.toml into a toml to JSON converter, make a
    wrangler.json
    , and pass the
    -j
    flag each time you call wrangler
  • s

    sathoro

    05/03/2023, 3:09 PM
    interesting... TOML is definitely weird
  • s

    sathoro

    05/03/2023, 3:09 PM
    this is very good to know!
  • s

    sathoro

    05/03/2023, 3:09 PM
    converting this code to use queues is a bit of a pain because we use the request and context variables which aren't present in the queue
  • s

    Skye

    05/03/2023, 3:10 PM
    You should be able to pass whatever you want into the queue message body, it just needs to be serializable
  • s

    sathoro

    05/03/2023, 3:17 PM
    Copy code
    js
    async queue(batch, env) {
      const request = {};
      const sentry = null;
      const context = {
        waitUntil: () => {},
      };
    
      withDurables({ parse: true })(request, env);
    
      let messages = batch.messages[0].body;
      console.log(`consumed from our queue: ${JSON.stringify(messages)}`);
    don't hate me
  • s

    sathoro

    05/03/2023, 3:28 PM
    it is working
  • l

    lgraz

    05/03/2023, 3:47 PM
    Does anyone know if there is an open source implementation similar to https://cloudflareworkers.com ?
  • u

    Unsmart | Tech debt

    05/03/2023, 3:48 PM
    you can run the runtime yourself if thats what you mean https://github.com/cloudflare/workerd
  • l

    lgraz

    05/03/2023, 3:52 PM
    Thanks! I've never used it so I'll check that out. I was wondering whether there was a project with a complete UI on top of an environment which can execute workers, effectively exactly what the workers playground is. I imagine there is no UI component included in workerd. Which is fine just wanted to see if something exists already!
  • s

    Skye

    05/03/2023, 3:53 PM
    There's a new quick edit coming soon™️ if that helps 👀
  • l

    lgraz

    05/03/2023, 3:53 PM
    Yeesssss 🙏
  • l

    lgraz

    05/03/2023, 3:53 PM
    That looks great
  • s

    sathoro

    05/03/2023, 3:55 PM
    btw how long is the max execution time in a queue? I probably should have asked before switching lol
  • s

    sathoro

    05/03/2023, 3:56 PM
    initial tests are looking good
  • s

    Skye

    05/03/2023, 3:56 PM
    15 minutes iirc
  • s

    sathoro

    05/03/2023, 3:58 PM
    hopefully we don't run into that
  • s

    sathoro

    05/03/2023, 4:17 PM
    if I upgrade to Business any thoughts if I could get that increased? 🤔
1...243324342435...2509Latest