GithubHelp home page GithubHelp logo

dart_cassandra_cql's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

pulyaevskiy isoos

dart_cassandra_cql's Issues

Uncaught Error: Bad state: StreamSink is bound to a stream

Hello,
Sometimes (it's not 100% reproducible) I have this error:

Unhandled exception:
Uncaught Error: Bad state: StreamSink is bound to a stream
Stack Trace:
#0      _StreamSinkImpl._controller (dart:io/io_sink.dart:219)
#1      _StreamSinkImpl.add (dart:io/io_sink.dart:143)
#2      _Socket.add (dart:io-patch/socket_patch.dart:1644)
#3      ChunkedOutputWriter.pipe.<anonymous closure> (package:dart_cassandra_cql/driver/stream/chunked_output_writer.dart:53:65)
#4      ListQueue.forEach (dart:collection/queue.dart:404)
#5      ChunkedOutputWriter.pipe (package:dart_cassandra_cql/driver/stream/chunked_output_writer.dart:53:28)
#6      FrameWriter.writeMessage (package:dart_cassandra_cql/driver/protocol/frame/frame_writer.dart:96:29)
#7      Connection._writeMessage.<anonymous closure> (package:dart_cassandra_cql/driver/connection/connection.dart:237:26)
#8      _RootZone.runUnary (dart:async/zone.dart:1155)
#9      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:484)
#10     _Future._propagateToListeners (dart:async/future_impl.dart:567)
#11     _Future._completeWithValue (dart:async/future_impl.dart:358)
#12     _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:412)
#13     _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#14     _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#15     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#16     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)

#0      _rootHandleUncaughtError.<anonymous closure> (dart:async/zone.dart:886)
#1      _asyncRunCallbackLoop (dart:async/schedule_microtask.dart:41)
#2      _asyncRunCallback (dart:async/schedule_microtask.dart:48)
#3      _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:84)
#4      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:131)

My code (Windows 7, Dart 1.8, Cassandra 2.1.2):

====================
main:
====================
void initCassandra(){
  List<String> queries = new List<String>();
   queries.add(common_dao.createSimpleKeyspaceQuery("bi"));
   queries.add(user_dao.getCreateTableQuery());
   cassandra.synchronizedQuery(queries);
}
void main() {
  initCassandra(); 

  HttpServer.bind(InternetAddress.LOOPBACK_IP_V4, 8080).then((server) {
    var router = new Router(server)
          ....
  });
}
========================
cassandra.dart:
========================
library cassandra;

import 'dart:async';
import 'package:dart_cassandra_cql/dart_cassandra_cql.dart' as cql;

void synchronizedQuery(List<String>queries){
  cql.Client client = new cql.Client.fromHostList(['localhost']);
  if(queries.isEmpty){
    return;
  }
  print("synchronizedQuery: query[0]: "+queries[0]);
  Future<cql.ResultMessage> f = client.execute(new cql.Query(queries[0]))
      .catchError((e){print("synchronizedQuery: Error: "+e.toString());});
  int i=1;
  while(i<queries.length){
    String q = queries[i];
    f.then((_){client.execute(new cql.Query(q));});
    i++;
  }
}

Something is it wrong ?
Thanks very much

Christophe

Is this package maintained?

Hi, as i have checked python driver, and its well maintained and updated, Thus; is this driver our of date? is it maintained?

Stream Example

Hey Man !!
Can you please give an example of stream using streambuilder.
Appreciate if you reply ๐Ÿ™‚

dartfmt everything?

While working #2 I noticed that library's code is not formatted with dartfmt.
I use Atom with Dart plugin and it formats files automatically on safe, which is super convenient since I don't have to worry about formatting and code style is guaranteed to be consistent throughout the project.

Would you be opposed to running dartfmt on all project files (in lib/ and test/)? This would simplify work on future PRs, as well as other benefits mentioned above.

Of course, I can submit a PR for this, if you're interested.

Load-balancing policies

Hey,

Just curious if there is anything similar to "Token aware" client policy in Java driver? (docs: https://docs.datastax.com/en/latest-java-driver/common/drivers/reference/tuningPolicies_c.html )

It seems that this should be configurable in connection pool, but I couldn't find anything just looking at the docs.

UPDATE:
NodeJS driver seems to support this as well
http://datastax.github.io/nodejs-driver/features/tuning-policies/#load-balancing-policy
https://github.com/datastax/nodejs-driver/blob/master/lib/policies/load-balancing.js

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.