GithubHelp home page GithubHelp logo

supermanscott / redis-activity-example Goto Github PK

View Code? Open in Web Editor NEW
21.0 2.0 3.0 96 KB

An example of an Aggregated Activity Feed using Redis

Home Page: supermanscott.com/redis-powered-activity-with-aggregation

Python 100.00%

redis-activity-example's Introduction

Activity Redis Example

Overview

Redis powered activity feed with Aggregation on user_id, activity_type and day. Setup as 4 Celeryd tasks new_activity, delete_activity, follow and unfollow.

Install

Download, install and run Redis::
http://redis.io/download
pip install -r requirements.txt
celeryd

Execute some tasks:

Python 2.7.3 (default, Apr 20 2012, 22:39:59)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> import tasks
>>> tasks.new_activity.delay(1, time.time(), 'picture')
<AsyncResult: 1cffc586-0442-4824-8c8f-7fc2c72de1ff>
>>> tasks.new_activity.delay(1, time.time(), 'like')
<AsyncResult: 20683c9f-676d-4f52-a911-b561f651bb0b>
>>> tasks.new_activity.delay(1, time.time(), 'picture')
<AsyncResult: 4e19bdc3-2c19-442a-93f9-065d22bdcdc9>
>>> tasks.follow_user.delay(1, 2)
<AsyncResult: c570c9c3-13d8-4688-ae41-0ebbdc337f45>

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.