Commit Graph

48 Commits

Author SHA1 Message Date
Helge Heß f3f50c7a01 Drop pre-Swift 5 compat in source
Remove if-swift versions, also ties it to NIO2.
2020-06-30 23:54:51 +02:00
Helge Heß 7ed9d3bb81 NIO 2 API: ctx => context
Sigh.
2019-03-29 17:37:22 +01:00
Helge Heß 44b14b7149 Fix Swift 4.x warnings
... public in fileprivate and such.
2019-03-27 19:08:44 +01:00
Helge Heß 644b39b12d Can't work w/o proper Swift 5 badge
Add it.
2019-03-27 14:25:29 +01:00
Helge Heß 59355c9d9c Swift 5: ContiguousCollection => Collection
Not quite sure whether this produces a performance
regression.
2019-03-27 14:23:33 +01:00
Helge Heß 681548ab70 Swift 5 / NIO 2: self.add(name:handler:) -> addHandler
Also the first/last enum.
2019-03-27 14:22:46 +01:00
Helge Heß 3005e79cb3 Swift 5 / NIO 2: write(xyz:) -> writeXYZ()
Same for write(integer:). Use fileprivate shim w/
NIO 2 API.
2019-03-27 14:22:25 +01:00
Helge Heß e208929877 Swift 5: Add Package\@swift-5.swift
Compile module against NIO 2 when Swift 5 is available.
2019-03-27 12:59:41 +01:00
Helge Heß 8de66b76e9 Travis: Tie to Swift 4.2
Do not build w/ Xcode 9.x. Doesn't know about #compiler
2019-03-26 19:09:14 +01:00
Helge Heß 20dc5d534b Swift 5: public public
Fix warnings when compiling w/ Swift 5 compiler in 4.x
mode.
2019-03-26 18:59:51 +01:00
Helge Heß b191d630fd Whitespace ...
...
2019-03-26 18:57:17 +01:00
Helge Heß ad86e6ca55 Update NIO version to 1.13.2
... not 2 yet, probably need a branch for this.
2019-03-26 18:56:25 +01:00
Helge Heß 2b9593bf91 Travis: Build against 5.0
... also update 4.2.3 and drop some older
swifts, which we don't really care about?
2019-03-26 18:55:27 +01:00
Helge Heß 49c0b96348 README: Fix badge
... point to right travis.
2018-07-26 12:40:27 +02:00
Helge Heß 612b356679 Travis: Use 4.1.1 instead of 4.1.0
... only the latest is the greatest.
2018-07-26 12:04:06 +02:00
Helge Heß 42ada111a4 Traivs: Add Xcode 9.4 and Linux 4.2 snap
Test builds on more platforms.
2018-07-26 11:58:39 +02:00
Helge Heß 60cc0feb25 Drop Redis client
This module is going to be just the plain NIO Redis
protocol implementation. The "opinionated" client
is dropped from the module. Get it over at Noze.io.
2018-07-26 11:48:13 +02:00
Helge Hess c3720e219d
Add a CONTRIBUTING.md, fix indent
... beautz is in the eye of the beholder.
2018-06-09 10:40:03 +02:00
Helge Heß 1a55bd2031
Merge pull request #4 from vkill/feature/add-tests
Add some tests
2018-06-09 10:27:32 +02:00
vkill a31aca0cda Add some tests 2018-06-02 23:10:20 +08:00
Helge Heß 35a408ee60
Update NIO to 1.8.0
... and don't use deprecated API anymore.
2018-05-31 17:29:56 +02:00
Helge Heß 57a3f2dea4
Beautz is in the eye of the beholder
... maybe. Maybe not.
2018-05-31 17:22:45 +02:00
Helge Heß de26ed6b35
Make RESPError CustomStringConvertible
... so that we get something useful when printing the error.
2018-05-31 17:19:38 +02:00
Helge Heß fb3afb9721
Share event-loop-group between client connections
... if the client is free-standing (not invoked from
an existing eventloop), use a shared group.
2018-04-20 11:21:38 +02:00
Helge Heß 3d4e01cc77
Merge branch 'develop' of github.com:NozeIO/swift-nio-redis into develop 2018-04-20 11:20:18 +02:00
Helge Heß 0d55e7e3c4
Reuse currentEventLoop for client connection
If the user didn't specify an explicit eventLoop,
use the currentEventLoop. If there is none, create
a new, 1-threaded EventLoopGroup as a fallback.
2018-04-20 11:19:21 +02:00
Helge Hess 301af0f4d6
Do not hardcode host 2018-04-19 20:33:18 +02:00
Helge Heß fb801ec102
Use Setty 1.5.0
https://github.com/apple/swift-nio/releases/tag/1.5.0
2018-04-19 16:56:51 +02:00
Helge Heß 542cfc17b4
Move byte buffer stuff to own file
Maybe I should submit that to NIO itself.
2018-04-16 17:19:53 +02:00
Helge Heß db37a8da9c
Rename RedisChannelHandler to RESPChannelHandler
Fix name.
2018-04-14 11:16:20 +02:00
Helge Heß aaf1b706c4
OMG - indent wrong!!!
No lint no fun.
2018-04-13 18:24:07 +02:00
Helge Heß dae92a76ac
Perf: Use more BB(integerAsString:)
... faster.
2018-04-13 18:15:57 +02:00
Helge Heß 9fe1bce783
itoa 2018-04-13 18:11:11 +02:00
Helge Heß 9011f2097c
Reduce size of RESPValue from 49 to 25
By backing RESPError fields in a class.
This way it isn't taking up storage in
each and every RESPValue.

25 is still > 24 though :-)

(thanks to @weissi for the suggestion)
2018-04-13 16:50:21 +02:00
Helge Heß 5b78b9db82
And a public init
... empty, just to make init public ...
2018-04-13 15:39:56 +02:00
Helge Heß 4631728dab
Open up more functions
... that we wanna override.
2018-04-13 15:35:31 +02:00
Helge Heß 4672c49331
Make RESPChannelHandler work as a base-class
... so that we subclass it.

Intention: workaround NIOAny wrapping overhead.
2018-04-13 15:32:04 +02:00
Helge Heß 8e12a8a910
Keep array context values around
... this may be a no-op optimization,
but well.

It is actually trigger to do the right thing here.
In this version we flush the `values` array, which
transfers ownership of the array buffer to the
RESPValue.
But that buffer is never going to be modified, so
it would be nice to keep it alive. But if we do
keep it alive, we also keep the RESPValues alive,
which may point to full ByteBuffer's, which is
not desirable.

Whatever you do in Swift, you loose ;-)
2018-04-13 15:04:02 +02:00
Helge Heß 9c42e91687
Use array for ParserState
Disadvantage is that we cannot reuse the
Contiguous value array for the top-level
item.
(we could try to cache the struct in an
 ivar w/ a few hops).

Another option would be to use a fixed
size array or even a buffer-bptr to avoid
the range checks.
2018-04-13 14:36:46 +02:00
Helge Heß 0f6b7baa77
Move RESPParser to own file/struct
Instead of being embedded in the RedisChannel,
move the parser out, into an own struct.

This way we may be able to avoid NIO channel
pipeline overhead (NIOAny wrapping).
2018-04-13 13:45:19 +02:00
Helge Heß 0fbc1becd2
Note on server 2018-04-12 16:19:23 +02:00
Helge Heß d623a10844
README: Break more indentation 2018-04-11 14:12:03 +02:00
Helge Heß 8e3e19b161
README: Break indent, fix text 2018-04-11 14:10:19 +02:00
Helge Hess 54e12c2285
Badges 2018-04-11 00:44:25 +02:00
Helge Hess cf75b7e6e5
README: Add some links 2018-04-11 00:36:11 +02:00
Helge Hess f20b75e159
Travis: Add Travis setup
Build for Linux 4.0.3/4.1.0 and Xcode 9.0/9.3.
2018-04-11 00:31:22 +02:00
Helge Hess 5fef65eb2f
Initial drop 2018-04-11 00:27:29 +02:00
Helge Heß e106fd7c21
Initial commit 2018-04-10 23:21:35 +02:00