https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-for-platforms
  • r

    rd

    05/22/2023, 2:35 PM
    whats the limit in workers for platforms as to how many workers can have? Trying to plan out architecthture.. if i should consolidate functions into routes in one Worker or do. 1 function per worker
  • h

    HardAtWork

    05/22/2023, 2:53 PM
    Per customer?
  • s

    Skye

    05/22/2023, 2:55 PM
    You can technically have as many as you want, but I wouldn't be surprised if, when there's pricing for everybody, that there would be some kind of (low) price for each worker that you store, so you may want to consider that in your design
  • u

    Unsmart | Tech debt

    05/22/2023, 3:26 PM
    Would this mean we could do something like create a custom KV binding where we can use 1 KV namespace for all customers and have it where it automatically adds a tenant id into each query that happens? 🤔
  • d

    Dani Foldi

    05/22/2023, 3:27 PM
    👀 do you mean binding prefixes?
  • u

    Unsmart | Tech debt

    05/22/2023, 3:29 PM
    By passing binding to customer workers I would assume that means we could do pretty much anything we want... even something like creating a binding to a planetscale db for example. But not really sure 🤷
  • d

    Dani Foldi

    05/22/2023, 3:30 PM
    I'd be happy if we could just have enforceable prefixes to built-in bindings - whether that comes from outbound workers (are those invoked for internal calls, like KV?) or something else is an implementation detail
  • s

    Skye

    05/22/2023, 3:31 PM
    I'd guess, it'd be like a way of passing regular Cloudflare bindings to your consumer script at runtime, rather than at upload time, like it is at the moment
  • h

    HardAtWork

    05/22/2023, 3:50 PM
    Would that include a way to dynamically get/fetch them too?
  • s

    Skye

    05/22/2023, 3:51 PM
    I don't know - it's speculation
  • h

    HardAtWork

    05/22/2023, 3:52 PM
    Would be cool to do something like env.KVDISPATCH
  • r

    rd

    05/22/2023, 5:21 PM
    yeah so customers can deign functions and put htem up , a group of functions on our end may just be a bunch of workers ,, OR one worker with 4-5 routes (1 per function) .. trying to figure out what makes sense
  • r

    rd

    05/22/2023, 5:22 PM
    like for a 'project' on our end
  • h

    HardAtWork

    05/22/2023, 6:25 PM
    I would recommend bundling them all into a single Worker. That means less time is spent on routing them, and less of a cost to you if you pay per script
  • h

    HardAtWork

    05/22/2023, 6:26 PM
    Other than increased size limits, there isn’t much of a benefit to splitting them up
  • r

    rd

    05/22/2023, 6:26 PM
    jsut thinking ii ts like 5-6 functions await promisies if the executon time too long
  • i

    istarkov

    05/22/2023, 7:00 PM
    Seems like images resize on a worker for platform https://developers.cloudflare.com/images/image-resizing/resize-with-workers/ does’t work. Only through /cdn-cgi/image Is it expected?
  • i

    istarkov

    05/22/2023, 7:12 PM
    Example of same worker deployed as ordinary worker Everything is ok with resizing https://check-image.wstd.work/cgi/image/IMG_0110_7HJWoMgorcaAyimP0XbQ7.jpeg?width=75&quality=80&format=auto And as a worker for platform (not ok) https://saas-test-b7wdc.wstd.work/cgi/image/IMG_0110_7HJWoMgorcaAyimP0XbQ7.jpeg?width=75&quality=80&format=auto Resize code is +- same as in docs
  • i

    istarkov

    05/22/2023, 7:27 PM
    Not an issue, as I can easily resize images using dispatcher worker, just havent found this behavior is documented
  • s

    samg

    05/23/2023, 1:44 AM
    @tanushree could we request access? we just got into the workers launchpad program 🙂
  • s

    samg

    05/23/2023, 1:44 AM
    we previously were in via Dyme Cloud, which is now defunct
  • s

    samg

    05/23/2023, 1:44 AM
    yay startup pivots
  • r

    rodrik

    05/23/2023, 2:41 PM
    Hi everyone, quick question around Workers for Platforms and Smart Placement: is Smart Placement supported for dynamic dispatcher workers, user workers and outbound workers? Is it configurable though the API?
  • t

    tanushree

    05/24/2023, 3:15 AM
    You might be the first person to have tried this out! This is seems odd to me though, something for us to investigate
  • t

    tanushree

    05/24/2023, 3:16 AM
    Yes! DM me your Cloudflare account ID
  • t

    tanushree

    05/24/2023, 3:18 AM
    Outbound Workers - need to confirm this. Is it configurable through API but will get back to you on how. What's your use case?
  • p

    penalosa

    05/24/2023, 9:22 AM
    Thanks for the feedback!: 1. We can definitely look into options here—cc @JacobMGEvans | Wrangler and @admah 2 & 3. Cmd/Ctrl+S will now force a refresh of the worker preview (auto-refreshed every second or so, but Cmd/Ctrl+S explicitly restarts the preview). It doesn't do a deploy by design. In general, we'd encourage a development workflow where you validate updates to your Worker in the Preview or HTTP tab, rather than through a full deploy. Would that work for your use case? Was there a specific reason you need to deploy the worker frequently while developing? We can definitely explore a new Save & Deploy shortcut though—Cmd/Ctrl+Shift+S or Cmd/Ctrl+K or something like that
  • r

    rodrik

    05/24/2023, 11:45 AM
    In our use case, we would leverage Smart Placement to take care of multi-regional backend connections for the dynamic dispatcher - as for the user workers and outbound workers, I guess we would like to have the Smart Placement behavior to do its thing, since we don't really always know the fetch behavior of user worker's code.
  • e

    eidam | SuperSaaS

    05/27/2023, 3:03 PM
    hey, are the cpu and subrequests limit working already? subrequests do not seem to be limited when I set the limit 🤔
  • Google IAP for TCP forwarding
    d

    devced_46565

    12/24/2023, 1:39 AM
    Hi, Can we update our worker.js script to include a connect() function that returns a TCP socket, i.e., Google IAP for TCP forwarding webhook between Cloudflare Worker and an internal ip address hosting our SMTP server at ‘imap-cfored-com:10025.’, https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/#connections-to-port-25-are-prohibited Regards, Hal