Comments (6)
@lucianboboc I am unable to recreate your failure.
This is what I tried:
1. Created a fresh directory.
2. Created a Package.swift file that contained:
import PackageDescription
let package = Package(
name: "CouchDB_50",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura-CouchDB.git", majorVersion: 1, minor: 4),
])
3. Created a file main.swift and copied your program from the ghist.
4. Added a few imports that were missing (Foundation, CouchDB, and SwiftyJSON).
5. Ran `swift build` to compile the code
6. Used CouchDB's Web UI to create a database called test
7. Ran `.build/debug/CouchDB_50`
I then get the following output:
update callback
2-4d46b416f975fed36e83d97da3789180
I will also point out that I tried running .build/debug/CouchDB_50
again after having deleting the test database. The program ends immediately with no output. Again as expected.
from kitura-couchdb.
Hi @shmuelk, Thank you for your message.
I'm using the Apache CouchDB 2.0 app for macOS and it runs in 'Admin Party' mode.
Indeed, the db object is updated and revision is increased, the issue is not about that, it is about the callback that's never received for the call to the update method:
database.update(id, rev: rev, document: newDocument) { rev, doc, error in
print("update callback")
}
Have you tried to run in Xcode?
I also tried to run in terminal using ./.build/debug/testApp and i have the same problem, it remains 'waiting' and doesn't end.
I checked again in activity monitor and swap was 40gb...
from kitura-couchdb.
What version of Kitura-CouchDB are you using?
from kitura-couchdb.
I'm using package 1.4
from kitura-couchdb.
I ran swift package generate-xcodeproj
from the command, opened the generated XCode project using XCode 8.2.1, built the project and ran the project. I got the following output:
update callback
2-4d46b416f975fed36e83d97da3789180
Program ended with exit code: 0
Again your program seems to work for me.
Can you try closing the Apache CouchDB 2.0 app for macOS, when you run the test?
from kitura-couchdb.
@shmuelk that was it, seems if i have the couchDB mac app open the update method will never be called and program doesn't end.
Thank you!
from kitura-couchdb.
Related Issues (20)
- Using `+` in a document `_id` HOT 7
- Update Documentation for filer & query
- How to get out of the Callback Hell HOT 1
- Improve documentation for queryByView with decodeDocuments HOT 1
- queryByView sometimes returns nil and sometimes returns the correct documents HOT 1
- QueryParameters.stale(.OK) returns 400 when used
- queryByView and reduce functions in views HOT 2
- Define dateEncodingStrategy HOT 1
- create a big database HOT 1
- error: dependency 'CouchDB' in target 'xxx' requires explicit declaration HOT 1
- Move to travis-ci.com (instead of travis.org) HOT 1
- Fix jazzy generated docs
- Improve documentation
- Add link to Jazzy docs to README
- Swift PM enters an infinite loop with CouchDB + Kitura HOT 6
- Support for Codable JSON rather than SwiftyJSON? HOT 2
- Authenticate using Cookies HOT 1
- Add support for Bulk get of documents HOT 1
- CouchDB Kitura NIO tests failing on Linux HOT 6
- Add IAM Authentication for Cloudant 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 kitura-couchdb.