{"id":42202697,"url":"https://github.com/keepchen/message-queue","last_synced_at":"2026-01-27T00:28:18.715Z","repository":{"id":57543825,"uuid":"293758377","full_name":"keepchen/message-queue","owner":"keepchen","description":" Using a double linked list to implement the same function as redis list,written in Go","archived":false,"fork":false,"pushed_at":"2020-09-16T04:17:16.000Z","size":12,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T03:40:10.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keepchen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-08T09:08:12.000Z","updated_at":"2020-09-22T01:24:22.000Z","dependencies_parsed_at":"2022-08-27T18:30:12.343Z","dependency_job_id":null,"html_url":"https://github.com/keepchen/message-queue","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/keepchen/message-queue","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepchen%2Fmessage-queue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepchen%2Fmessage-queue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepchen%2Fmessage-queue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepchen%2Fmessage-queue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keepchen","download_url":"https://codeload.github.com/keepchen/message-queue/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keepchen%2Fmessage-queue/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28793132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T21:49:50.245Z","status":"ssl_error","status_checked_at":"2026-01-26T21:48:29.455Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-27T00:28:18.604Z","updated_at":"2026-01-27T00:28:18.688Z","avatar_url":"https://github.com/keepchen.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# message queue\n\n[![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/keepchen/message-queue?tab=overview)\n\n#### 简介\n\n使用双向链表实现类似redis的list功能，编程语言用golang实现。\n\n#### 安装\n\n```shell\ngo get github.com/keepchen/message-queue/queue\n```\n\n#### 调用示例\n\n* 获取实例\n\n```golang\nimport \"github.com/keepchen/message-queue/queue\"\n\ninstance := queue.GetDBInstance(\"db1\")\n\n# 关闭打印信息\ninstance = instance.SetDebugMode(false)\n```\n\n* 向左侧追加\n\n```golang\ninstance.LPush(0)\ninstance.LPush(\"a\")\ninstance.LPush(map[string]int{\"age\":1})\n```\n\n* 向右侧追加\n\n```golang\ninstance.RPush(0)\ninstance.RPush(\"a\")\ninstance.RPush(map[string]int{\"age\":1})\n```\n\n* 取左侧第一个节点值\n\n```golang\nval, err := instance.LPop()\n```\n\n* 取右侧第一个节点值\n\n```golang\nval, err := instance.RPop()\n```\n\n* 打印当前列表值(从左向右)\n\n```golang\ninstance.DisplayQueue()\n```\n\n* 获取数据库列表\n\n```golang\n dbSlice := instance.GetDBList()\n```\n\n* 删除当前数据库\n\n```golang\n err := instance.FlushDB()\n```\n\n#### benchmark\n\n运行`go run main.go`即可获得benchmark结果\n\n* 环境：\n\n```\nOS\n-------------------------------------------------------------------------------------\n             ............                keepchen@keepchen-PC \n         .';;;;;.       .,;,.            -------------------------- \n      .,;;;;;;;.       ';;;;;;;.         OS: Deepin 15.11 x86_64 \n    .;::::::::'     .,::;;,''''',.       Model: ESC300 G4 \n   ,'.::::::::    .;;'.          ';      Kernel: 4.15.0-30deepin-generic \n  ;'  'cccccc,   ,' :: '..        .:     Uptime: 29 minutes \n ,,    :ccccc.  ;: .c, '' :.       ,;    Packages: 1831 \n.l.     cllll' ., .lc  :; .l'       l.   Shell: zsh 5.3.1 \n.c       :lllc  ;cl:  .l' .ll.      :'   Resolution: 1920x1080, 1600x900 \n.l        'looc. .   ,o:  'oo'      c,   DE: Deepin \n.o.         .:ool::coc'  .ooo'      o.   WM: KWin \n ::            .....   .;dddo      ;c    Theme: Deepin [GTK2/3] \n  l:...            .';lddddo.     ,o     Icons: Deepin [GTK2/3] \n   lxxxxxdoolllodxxxxxxxxxc      :l      Terminal: deepin-terminal \n    ,dxxxxxxxxxxxxxxxxxxl.     'o,       CPU: Intel i3-7100 (4) @ 3.9GHz \n      ,dkkkkkkkkkkkkko;.    .;o;         GPU: NVIDIA GeForce GT 710B \n        .;okkkkkdl;.    .,cl:.           Memory: 2772MB / 15990MB \n            .,:cccccccc:,.                \n                                         ████████████████████████\n\nGolang\n-------------------------------------------------------------------------------------\ngo version go1.15 linux/amd64\n\n```\n\n* 测试结果：\n\n| 操作/数量 | 10000次    | 100000次    | 1000000次    |\n| --------- | ---------- | ----------- | ------------ |\n| LPush     | 0.827006ms | 12.559893ms | 140.601657ms |\n| RPush     | 1.080579ms | 13.262032ms | 130.045112ms |\n| LPop      | 0.675541ms | 7.199598ms  | 57.969342ms  |\n| RPop      | 0.723422ms | 9.694183ms  | 71.108501ms  |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepchen%2Fmessage-queue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeepchen%2Fmessage-queue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeepchen%2Fmessage-queue/lists"}