Skip to content

Commit

Permalink
Merge pull request #40 from tchaloupka/vibe_core
Browse files Browse the repository at this point in the history
Drop support for old vibe-d:core and some deprecated code removal
  • Loading branch information
denizzzka authored Sep 7, 2020
2 parents 8e8b652 + e7ed3a3 commit caef9ae
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ before_script:
script:
- dub test
- dub run --config=integration_test -- --conninfo="${CONN_STRING}" --debug=true
- dub run --config=integration_test_vibe_core -- --conninfo="${CONN_STRING}" --debug=true
- dub build :example

matrix:
Expand Down
10 changes: 1 addition & 9 deletions dub.sdl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ copyright "Copyright © 2016"
targetType "sourceLibrary"

dependency "dpq2" version="~>1.0.7"
dependency "vibe-d:core" version=">=0.8.3 <0.10.0"
dependency "vibe-core" version=">=1.7.0 <2.0.0-0"

configuration "release_app" {
buildType "release"
Expand All @@ -18,14 +18,6 @@ configuration "integration_test" {
versions "IntegrationTest"
}

configuration "integration_test_vibe_core" {
targetType "executable"
buildType "unittest"
versions "IntegrationTest"
dependency "vibe-core" version=">=1.4.0 <2.0.0"
subConfiguration "vibe-d:core" "vibe-core"
}

subPackage {
name "example"
sourcePaths "example"
Expand Down
29 changes: 4 additions & 25 deletions source/vibe/db/postgresql/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ class PostgresClient
}

alias Connection = Dpq2Connection;
deprecated("use Connection instead") alias __Conn = Connection;

///
alias LockedConnection = VibeLockedConnection!Connection;
Expand Down Expand Up @@ -137,12 +136,6 @@ class Dpq2Connection : dpq2.Connection
settings.afterStartConnectOrReset(this);
}

deprecated("please use .reset() instead")
void resetStart()()
{
reset();
}

/// Blocks while connection will be established or exception thrown
void reset()
{
Expand All @@ -155,10 +148,7 @@ class Dpq2Connection : dpq2.Connection

if(resetPoll() != PGRES_POLLING_OK)
{
auto event = socketEvent();
version(Have_vibe_core) {}
else scope(exit) destroy(event);
event.wait(socketTimeout);
socketEvent().wait(socketTimeout);
continue;
}

Expand All @@ -179,25 +169,14 @@ class Dpq2Connection : dpq2.Connection
assert((fcntl(this.posixSocket, F_GETFL, 0) & O_NONBLOCK), "Socket assumed to be non-blocking already");
}

version(Have_vibe_core)
{
// vibe-core right now supports only read trigger event
// it also closes the socket on scope exit, thus a socket duplication here
auto event = createFileDescriptorEvent(this.posixSocketDuplicate, FileDescriptorEvent.Trigger.read);
}
else
{
auto event = createFileDescriptorEvent(this.posixSocket, FileDescriptorEvent.Trigger.any);
}

return event;
// vibe-core right now supports only read trigger event
// it also closes the socket on scope exit, thus a socket duplication here
return createFileDescriptorEvent(this.posixSocketDuplicate, FileDescriptorEvent.Trigger.read);
}

private void waitEndOfReadAndConsume(in Duration timeout)
{
auto event = socketEvent();
version(Have_vibe_core) {}
else scope(exit) destroy(event); // Prevents 100% CPU usage

do
{
Expand Down

0 comments on commit caef9ae

Please sign in to comment.