Comments (8)
I think another point that can be arguable is using Jackson library instead of json-simple in that optimization process.
from pushy.
@okohub Can you elaborate? Why would that help?
from pushy.
ApnsBuilder is complicated. There are lots of things in a one "builder" class. Creating a JSON from builder result is also complicated i think. First of all, using a better library for JSON serializing and dividing core part to POJOs will help developers to improve pushy. Jackson is very powerful at POJOs. You don't have to check attribute is existing or not for serializing, for example.
from pushy.
You don't have to check attribute is existing or not for serializing, for example.
The APNs payload is a tricky beast. In some cases, these things are all interpreted differently by the receiving device:
- An attribute is present and has a non-
null
value - An attribute is present and its value is
null
- An attribute is not present
Jackson (or other libraries) that work by serializing POJOs deprive us of the expressive flexibility we need to reach all of those cases (i.e. there isn't a good way to differentiate between "present and null" and "not present").
from pushy.
Just an idea that when builder is called maybe the length+key length shall be calculated on the spot.
For example, builder.badge(10) increase length by 5(badge) + 1":" + 2(10). And consider the {} together, when build() is called the length shall be evaluated immediately, cause the key and symbols is predefined.
from pushy.
I've been looking through changelogs while updating our dependency and seen this:
Jackson (or other libraries) that work by serializing POJOs deprive us of the expressive flexibility we need to reach all of those cases (i.e. there isn't a good way to differentiate between "present and null" and "not present").
Jackson is not limited to pojo processing mode: there are other modes, such as Tree Model. Take a look at the 'Constructing Tree Model instances from Scratch' section.
from pushy.
FWIW, we switched to Gson a while ago.
from pushy.
Yeah, sorry, totally didn't see the date of that comment.
from pushy.
Related Issues (20)
- Intermittent layer 7 firewall blocks due to missing SNI HOT 2
- Requesting to release a new tag for Live activity support HOT 2
- Failed to create channel java.io.IOException: Connection reset by peer HOT 6
- upgrade the netty-transport from 4.0.37 to 4.1.37 HOT 2
- pushy0.15.0 Stream closed before a reply was received HOT 1
- Connection reset by peer. HOT 3
- ipv6 problem HOT 2
- java.util.concurrent.ExecutionException: io.netty.handler.codec.http2.Http2Exception: Error decoding headers: io/netty/handler/codec/http/HttpHeaderValidationUtil HOT 1
- pushy0.15.2 Stream closed before a reply was received And GOAWAYException HOT 2
- Is the proxy way to replace this? Then a mistake was made
- javax.net.ssl.SSLHandshakeException: Server chose TLSv1, but that protocol version is not enabled or not supported by the client. HOT 5
- Stream closed before write could take place HOT 4
- push 0.15.1 io.netty.handler.codec.http2.StreamBufferingEncoder$Http2GoAwayException in a lot of requests HOT 2
- Multiple certificates push error!
- Push Notifications from Wildfly HOT 1
- "Failed to resolve..." APNS endpoints in Pushy 0.15.1 HOT 3
- Pushy fails on Mac OS recent releases HOT 1
- I send background notifications but app can not received HOT 1
- CVE-2022-24823 - Reference to Netty is for outdated version with known security vulnerability. HOT 2
- APNS Connection Issue: Unable to resolve host HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pushy.