GithubHelp home page GithubHelp logo

Comments (6)

phungleson avatar phungleson commented on May 22, 2024 1

I am closing this as nothing much to do about it and it is end of the year.

Happy NY to you, have a good time with family and friends! @sunli829

from poem.

sunli829 avatar sunli829 commented on May 22, 2024

For postgres, not sure if it is correct or not but it looks like it will fail if session column is not JSONB. If it is then maybe there should be a note.

Yes, if you use postgres, the session column must be jsonb.

/// # Create the table for session storage

Cleanup task should probably be configurable. When we have multiple poem servers running, we probably don't want every server to ping database to do clean up. I am not sure what the best way to approach this as some pros and cons of each setup or we just need to accept the duplicate jobs?

You are right, so I changed it, and now only provides a cleanup function, users need to call it themselves.

Not very high priority, the value of in session in db looks like this {"id": ""xxx""}, it looks like the library does serialising twice at some points. It doesn't seem to affect how it works, nevertheless it is kind of nice to have correct json presentation.

It does serialize twice, but works fine. 🙂

from poem.

phungleson avatar phungleson commented on May 22, 2024

Not very high priority, the value of in session in db looks like this {"id": ""xxx""}, it looks like the library does serialising twice at some points. It doesn't seem to affect how it works, nevertheless it is kind of nice to have correct json presentation.

It does serialize twice, but works fine. 🙂

Yeah looks like it is due to Session is using entries: BTreeMap<String, String>, coming from other languages I see people keep session in a more flexible JSON format.

https://github.com/gorilla/sessions/blob/master/sessions.go#L36

Not saying it is the standard but just something from prior art to consider.

from poem.

sunli829 avatar sunli829 commented on May 22, 2024

I thought you didn't care about this. 🙂

from poem.

sunli829 avatar sunli829 commented on May 22, 2024

Fixed in v.1.2.8

from poem.

phungleson avatar phungleson commented on May 22, 2024

Awesome thx!

I was taking a break so that you can do more productive work elsewhere jk jk ;)

Btw some shower thoughts this morning, happy if you say the following idea is not worth the effort.. etc..:

Basically in Go, people extract session into a separate library https://github.com/gorilla/sessions so that it can grow by itself, i.e. used for different servers or different stores. Not sure if it is worth doing the same thing in Rust? since poem session looks more or less self contained already.

I am not sure how other servers would use it though, cheers

from poem.

Related Issues (20)

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.