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

    kian

    05/03/2023, 10:45 PM
    Any egress IP assigned to that colo could be used, even changing between requests
  • s

    silentdevnull

    05/03/2023, 11:42 PM
    I have 2 workers is it possible to make it were worker B can only be called from worker A without having to add custom domains and WAF rules? Trying to make it simple as possible.
  • j

    James

    05/03/2023, 11:43 PM
    Maybe Service Bindings is what you're after? https://developers.cloudflare.com/workers/platform/bindings/about-service-bindings/
  • s

    silentdevnull

    05/04/2023, 2:36 AM
    Thank you, That does look what I'm looking for. Thank you
  • s

    sathoro

    05/04/2023, 5:36 AM
    can anyone help me figure out how many UUIDs (v4) I could store in a single DO value (in an array)? I'm not sure how to get the V8 serialization size
  • s

    sathoro

    05/04/2023, 5:59 AM
    Copy code
    js
    const { serialize } = require("v8");
    const crypto = require('node:crypto');
    
    const serializedOne = serialize([crypto.randomUUID()]);
    const serializedTwo = serialize([crypto.randomUUID(), crypto.randomUUID()]);
    
    console.log(`Size one: ${serializedOne.length}`);
    console.log(`Size two: ${serializedTwo.length}`);
    
    const sizePerUUID = serializedTwo.length - serializedOne.length;
    const fixedOverhead = serializedOne.length - sizePerUUID;
    const durableObjectValueLimit = 131072;
    
    console.log(`Max UUIDs allowed: ${Math.floor((durableObjectValueLimit - fixedOverhead) / sizePerUUID)}`);
    3449 if my math is right
  • d

    Dani Foldi

    05/04/2023, 7:28 AM
    (disclaimer, I'm not on the team and I base my answer on some experience with workerd) It does look like you are correct in your case, if you store the uuid as a Uint8Array (conversion required both when storing & fetching to get the current form), I believe you can save more as they would only take up 16 bytes (+ overhead) instead of 36 (+ overhead)
  • s

    sathoro

    05/04/2023, 1:33 PM
    thank you 😄
  • s

    sathoro

    05/04/2023, 1:35 PM
    I wish CF had better support for long running tasks - Workers can already stay alive indefinitely as long as there is a request attached to it so why is there a tight limit on the length of
    waitUntil
    and Queue worker lifetimes? it makes long running background requests very tough to do 😦
  • s

    sathoro

    05/04/2023, 2:06 PM
    maybe I should create a server with the sole purpose of opening long running connections to my worker to get past the limits 🤣
  • j

    jessec

    05/04/2023, 7:45 PM
    Should node_compat work in quick edit mode?
    Copy code
    Uncaught Error: No such module "node:buffer".  imported from "worker.js"
  • k

    kian

    05/04/2023, 7:46 PM
    Probably not
  • e

    Erisa | Support Engineer

    05/04/2023, 8:06 PM
    It does not
  • a

    As

    05/04/2023, 8:24 PM
    Would it be possible to self host elasticsearch on a cloudflare worker? And is this a good idea...?
  • s

    Skye

    05/04/2023, 8:28 PM
    I would be incredibly doubtful that that would be possible
  • s

    Skye

    05/04/2023, 8:29 PM
    Workers aren't long running processes - think of them as server-side service workers from a browser
  • a

    As

    05/04/2023, 8:29 PM
    yeahhh... I couldn't find any info on it and using elastic cloud seems a bit expensive for my current use case
  • a

    As

    05/04/2023, 8:29 PM
    Could I use another cloudflare tool for this? Like durable objects?
  • s

    Skye

    05/04/2023, 8:30 PM
    If you built it yourself, sure
  • a

    As

    05/04/2023, 8:31 PM
    I'm not sure I understand
  • s

    Skye

    05/04/2023, 8:32 PM
    You wouldn't be able to just run elastic search
  • s

    Skye

    05/04/2023, 8:32 PM
    You could build your own search on durable objects
  • a

    As

    05/04/2023, 8:32 PM
    Oh...
  • s

    Skye

    05/04/2023, 8:33 PM
    You'd probably find it easier to just get a VPS
  • s

    Skye

    05/04/2023, 8:33 PM
    Something like fly.io has a decent free tier
  • a

    As

    05/04/2023, 8:33 PM
    I'm looking for something cheap but still scalable
  • a

    As

    05/04/2023, 8:33 PM
    well cheap at the start, but can scale up and get more expensive
  • a

    As

    05/04/2023, 8:36 PM
    ^ the cloud would probably be perfect for this - but most solutions are really expensive. Elastic cloud is around 35 - 40 usd a month
  • s

    Skye

    05/04/2023, 8:36 PM
    Unfortunately there's not really any CF product for that kind of thing
  • a

    As

    05/04/2023, 8:37 PM
    What's the reason that I can't run elastic search on durable objects?
1...243524362437...2509Latest