memcached_client 0.5.3

  • Installing
  • Versions
  • 30

#Memcached Client

Memcached Client is a client implementation in Dart language of the famous distributed memory object caching system, [Memcached] (

Memcached Client is distributed under the Apache 2.0 License.

##Install from Dart Pub Repository

Add this to your pubspec.yaml (or create it):


Then run the Pub Package Manager (comes with the Dart SDK):

pub install

##Install from Github for Bleeding Edge Stuff

To install stuff that is still in development, add this to your pubspec.yam:

    git: git://

For more information, please refer to [Pub: Dependencies] (


Using Memcached Client is straightforward. Connect to the server and use the client's APIs to access the database.

import "dart:convert" show UTF8;
import "dart:async";
import "package:memcached_client/memcached_client.dart";

void main() {
  // Connect to server per the provided SocketAddress
  // Here assume your Memcached Server is installed on localhost
  MemcachedClient.connect([new SocketAddress("", 11211)])
  // When client is ready, access the database
  .then((client) => access(client))
  // Catch all possible errors/exceptions
  .catchError((err) => print('Exception: $err'));

// The unique document id of the document
final String DOC_ID = "beer_Wrath";

// The Json encoded document
final String VALUE =
  '"updated":"2010-07-22 20:00:20",'
  '"description":"WRATH Belgian-style ",'
  '"style":"Other Belgian-Style Ales",'
  '"category":"Belgian and French Ale"}';

Future access(MemcachedClient client) {
  // Do a set
  return client.set(DOC_ID, encodeUtf8(VALUE))
  // Check if set succeeded and show message
  .then((ok) => print(ok ? "Set Succeeded" : "Set failed"))
  // Then get the value back by document id
  .then((_) => client.get(DOC_ID))
  // Check if get data equals to set one
  .then((val) => UTF8.decode( == VALUE)
  // Show message
  .then((ok) => print(ok ? "Get Succeeded" : "Get failed"))
  // Close the client
  .then((_) => client.close());

##Notes to Contributors

###Test and Debug

You are welcome to submit [bugs and feature requests] ( Or even better if you can fix or implement them!

###Fork Memcached Client

If you'd like to contribute back to the core, you can [fork this repository] ( and send us a pull request, when it is ready.

Please be aware that one of Memcached Client's design goals is to keep the sphere of API as neat and consistency as possible. Strong enhancement always demands greater consensus.

If you are new to Git or GitHub, please read this guide first.

1. Depend on it

Add this to your package's pubspec.yaml file:

  memcached_client: "^0.5.3"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:memcached_client/memcached_client.dart';
Version Uploaded Documentation Archive
0.5.3 Jun 25, 2014 Go to the documentation of memcached_client 0.5.3 Download memcached_client 0.5.3 archive
0.5.2 Jun 25, 2014 Go to the documentation of memcached_client 0.5.2 Download memcached_client 0.5.2 archive
0.5.1+1 Oct 30, 2013 Go to the documentation of memcached_client 0.5.1+1 Download memcached_client 0.5.1+1 archive
0.5.1 Oct 30, 2013 Go to the documentation of memcached_client 0.5.1 Download memcached_client 0.5.1 archive
0.5.0+2 Sep 12, 2013 failed Download memcached_client 0.5.0+2 archive
0.5.0+1 Sep 9, 2013 failed Download memcached_client 0.5.0+1 archive
0.5.0 Aug 20, 2013 failed Download memcached_client 0.5.0 archive
0.4.0+1 Aug 5, 2013 failed Download memcached_client 0.4.0+1 archive
0.3.0+7 Jun 17, 2013 failed Download memcached_client 0.3.0+7 archive
0.3.0+6 Jun 11, 2013 failed Download memcached_client 0.3.0+6 archive

All 18 versions...


We analyzed this package on Mar 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.31.0
  • pana: 0.10.3


Describes how popular the package is relative to other packages. [more]
5 / 100
Code health derived from static analysis. [more]
92 / 100
Reflects how tidy and up-to-date the package is. [more]
0 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: Flutter, other

Primary library: package:memcached_client/memcached_client.dart with components: io.


  • Maintain

    Changelog entries help clients to follow the progress in your code.

  • Use constrained dependencies.

    The pubspec.yaml contains 2 dependencies without version constraints. Specify version ranges for the following dependencies: crypto, logging.

  • Fix issues reported by dartanalyzer or dartfmt.

    dartanalyzer or dartfmt reported 17 errors 101 hints.

    Strong-mode analysis of lib/src/BinaryConnectionFactory.dart failed with the following error:

    line: 10 col: 31
    Base class introduces an invalid override. The type of 'ConnectionFactoryBase.createLocator' ('(List<MemcachedNode>) → Future<NodeLocator>') isn't a subtype of 'ConnectionFactory.createLocator' ('(Iterable<MemcachedNode>) → Future<NodeLocator>').

    Strong-mode analysis of lib/src/TapClient.dart failed with the following error:

    line: 117 col: 10
    The getter 'stream' isn't defined for the class 'OP'.

    Similar analysis of the following files failed:

    • lib/src/TextConnectionFactory.dart (error)
    • lib/src/op/text/TextUnlockOP.dart (error)
    • lib/src/spi/ArrayModNodeLocator.dart (error)
    • lib/src/spi/ConnectionFactoryBase.dart (error)
    • lib/src/spi/HashAlgorithm.dart (error)
    • lib/src/spi/KetamaNodeLocator.dart (error)
    • lib/src/spi/MemcachedClientImpl.dart (error)
    • lib/src/util/AsyncUtil.dart (error)
    • lib/src/util/ByteUtil.dart (error)
    • lib/src/util/HttpUtil.dart (error)
    • lib/src/MemcachedClient.dart (hint)
    • lib/src/auth/AuthDescriptor.dart (hint)
    • lib/src/op/OP.dart (hint)
    • lib/src/op/OPChannel.dart (hint)
    • lib/src/op/OPFactory.dart (hint)
    • lib/src/op/OPState.dart (hint)
    • lib/src/op/OPStatus.dart (hint)
    • lib/src/op/OPType.dart (hint)
    • lib/src/op/ObserveResult.dart (hint)
    • lib/src/op/ObserveStatus.dart (hint)
    • lib/src/op/StreamOP.dart (hint)
    • lib/src/op/VbucketAwareOP.dart (hint)
    • lib/src/op/binary/BinaryDeleteOP.dart (hint)
    • lib/src/op/binary/BinaryGetAndLockOP.dart (hint)
    • lib/src/op/binary/BinaryGetAndTouchOP.dart (hint)
    • lib/src/op/binary/BinaryGetOP.dart (hint)
    • lib/src/op/binary/BinaryGetSingleOP.dart (hint)
    • lib/src/op/binary/BinaryKeyStatsOP.dart (hint)
    • lib/src/op/binary/BinaryMemcachedNodeImpl.dart (hint)
    • lib/src/op/binary/BinaryMutateOP.dart (hint)
    • lib/src/op/binary/BinaryNoOP.dart (hint)
    • lib/src/op/binary/BinaryOP.dart (hint)
    • lib/src/op/binary/BinaryOPChannel.dart (hint)
    • lib/src/op/binary/BinaryOPFactory.dart (hint)
    • lib/src/op/binary/BinaryStatsOP.dart (hint)
    • lib/src/op/binary/BinaryStoreOP.dart (hint)
    • lib/src/op/binary/BinaryTouchOP.dart (hint)
    • lib/src/op/binary/BinaryUnlockOP.dart (hint)
    • lib/src/op/binary/BinaryVersionOP.dart (hint)
    • lib/src/op/binary/MultiKeyOP.dart (hint)
    • lib/src/op/binary/ObserveOP.dart (hint)
    • lib/src/op/binary/SaslAuthOP.dart (hint)
    • lib/src/op/binary/SaslMechsOP.dart (hint)
    • lib/src/op/binary/SaslOP.dart (hint)
    • lib/src/op/binary/SaslStepOP.dart (hint)
    • lib/src/op/binary/SingleKeyOP.dart (hint)
    • lib/src/op/tap/RequestMessage.dart (hint)
    • lib/src/op/tap/ResponseMessage.dart (hint)
    • lib/src/op/tap/TapAck.dart (hint)
    • lib/src/op/tap/TapAckOP.dart (hint)
    • lib/src/op/tap/TapBackfillOP.dart (hint)
    • lib/src/op/tap/TapDumpOP.dart (hint)
    • lib/src/op/tap/TapOpcode.dart (hint)
    • lib/src/op/tap/TapRequestFlag.dart (hint)
    • lib/src/op/tap/TapRequestOP.dart (hint)
    • lib/src/op/tap/TapResponseFlag.dart (hint)
    • lib/src/op/tap/TapStream.dart (hint)
    • lib/src/op/text/TextDeleteOP.dart (hint)
    • lib/src/op/text/TextGetAndLockOP.dart (hint)
    • lib/src/op/text/TextGetOP.dart (hint)
    • lib/src/op/text/TextGetSingleOP.dart (hint)
    • lib/src/op/text/TextMemcachedNodeImpl.dart (hint)
    • lib/src/op/text/TextMutateOP.dart (hint)
    • lib/src/op/text/TextNoOP.dart (hint)
    • lib/src/op/text/TextOPChannel.dart (hint)
    • lib/src/op/text/TextOPFactory.dart (hint)
    • lib/src/op/text/TextOPStatus.dart (hint)
    • lib/src/op/text/TextSingleKeyOP.dart (hint)
    • lib/src/op/text/TextStatsOP.dart (hint)
    • lib/src/op/text/TextStoreOP.dart (hint)
    • lib/src/op/text/TextTouchOP.dart (hint)
    • lib/src/op/text/TextVersionOP.dart (hint)
    • lib/src/spi/ConnectionObserver.dart (hint)
    • lib/src/spi/FailureMode.dart (hint)
    • lib/src/spi/MemcachedConnection.dart (hint)
    • lib/src/spi/MemcachedNode.dart (hint)
    • lib/src/spi/TapConnectionProvider.dart (hint)
    • lib/src/util/Enum.dart (hint)
    • lib/src/util/HashCodeUtil.dart (hint)
    • lib/src/util/LoggingUtil.dart (hint)
    • lib/src/util/Observable.dart (hint)
    • lib/src/util/SocketAddress.dart (hint)
  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

  • Maintain an example.

    Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use memcached_client.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.4.0
crypto any 2.0.2+1
logging any 0.11.3+1
Transitive dependencies
charcode 1.1.1
collection 1.14.5
convert 2.0.1
typed_data 1.1.5
Dev dependencies
unittest any