Replies: 1 comment
-
No. Netty event loop groups use platform threads, and all by all indications the Netty folks intend to keep them that way—for very valid performance reasons.
I'm not entirely sure I understand what you mean here, but I think I do and I also think this is not accurate. Event loops will write data to the underlying socket as quickly as the socket will accept them, and that's really not affected by what's happening on the APNs server. At the protocol level, though, APNs uses HTTP/2, and HTTP/2 allows the server to impose a limit on the number of concurrent streams. Pushy will wait for new streams to become available (i.e. for the APNs server to process/acknowledge some other request) before sending more requests, but adding more threads or different threads will not change that situation. |
Beta Was this translation helpful? Give feedback.
-
Hi,
We plan to upgrade our java version to 21 so that we can to use virtualThreadExecutors in our blocking operations such as sending push notifications.
I can pass custom executor to NioEventLoopGroup while creating ApnsClient, however, the executor in NioEventLoopGroup should be able to invoke schedule method which I guess virtualThreadExecutor is not able to do that.
May I pass virtualThreadExecutor to NioEventLoopGroup such that new NioEventLoopGroup(16, Executors.newVirtualThreadPerTaskExecutor())?
Have you ever benchmark virtualThreadExecutors and EventLoopGroup?
I am well aware that EventLoops buffers the requests but still there is just one thread consuming a channel. I can increase channel and thread count but the threads will wait APNs server to consume another request from channels. That is why I want to try virtualThreadPerTaskExecutors while sending push notifications.
Is there a way to do that?
Beta Was this translation helpful? Give feedback.
All reactions