This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

An asynchronous session backend with mongodb for tornado.

Project Description

Torsession is an async && sync session backend with Mongodb for Tornado.

Installation

$ pip install torsession

Example

Async example.

from torsession.async import SessionManager

# Initialize SessionManager
sm = SessionManager(motor.MotorClient())

# create a new session or load a session
session = yield sm.new_session()
session = yield sm.load_session("session id")

# set a key-value pair
yield session.set(key, val)

# get key
val = yield session.get(key)

# delete a key
yield session.delete(key)

# refresh session id
yield session.refresh_id()

# clear a session
yield session.clear()

Sync example.

from torsession.sync import SessionManager

# Initialize SessionManager
sm = SessionManager(pymongo.MotorClient())

# create a new session or load a session
session = sm.new_session()
session = sm.load_session("session id")

# set a key-value pair
session.set(key, val)

# get key
val = session.get(key)

# delete a key
session.delete(key)

# refresh session id
session.refresh_id()

# clear a session
session.clear()

LICENSE

MIT

Release History

Release History

This version
History Node

0.2.9

History Node

0.2.8

History Node

0.2.7

History Node

0.2.6

History Node

0.2.5

History Node

0.2.4

History Node

0.2.3

History Node

0.2.2

History Node

0.2.1

History Node

0.2.0

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
torsession-0.2.9-py2.7.egg (7.3 kB) Copy SHA256 Checksum SHA256 2.7 Egg Aug 28, 2016
torsession-0.2.9.tar.gz (3.1 kB) Copy SHA256 Checksum SHA256 Source Aug 28, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting