Redis integration

About Monkey 2 Forums Monkey 2 Programming Help Redis integration

This topic contains 4 replies, has 3 voices, and was last updated by  Simon Armstrong 2 years ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7567

    jason
    Participant

    Any thoughts on best approaches to access redis from monkey?

    #7568

    Simon Armstrong
    Participant

    The recommended C client for redis seems to be this one https://github.com/redis/hiredis which unfortunately uses a vararg based API but still perhaps simplest way to connect from monkey2 with a bit of glue code.

    What experience have you had and do you have an immediate use case for this?

    #7569

    jason
    Participant

    Thanks . . . I was using redis to store variables for realtime parametric adjustments in a local network for rapid prototyping in the IDE across multiple builds and nearby wireless devices. (Formerly Mac and iPad… now moving to custom platforms)

    To me, this is essential to game development to be able to see changes reflected live and tweak them instantly.

    I wanted to rewrite the socket server in monkey and see how it compares.

    I’m a bit clueless at the moment as to how to run C in combo with monkey as well as typecast the values over to monkey variables . . . can you point to some example code that demonstrates something similar?

    #7573

    abakobo
    Participant

    there is the c2mx2 tool(src/c2mx2.monkey2, you have to install LLVM read readme of c2mx2).Tthat could do this for you automatically (with luck), it will be a good base and warn you for some parts that he could not glue correctly.

    I made some little exercices example for external imports here:
    https://github.com/abakobo/learn_monkey2/tree/master/externs
    https://github.com/abakobo/learn_monkey2/tree/master/char_t
    (not sure all this works fine 😉

    const does not exist in monkey2 so sometimes it is a problem (with abstract/pure virtual things mostly).
    for chars you’ll want to use libc module’s char_t types:

    [/crayon]

    unfortunately not findable in the docs because of some doc generation bug…

    #7576

    Simon Armstrong
    Participant

    Hi Jason, if you have an online server I can test with (or link to simple one I can run locally) I would be keen to prototype a hiredis based monkey2 module.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.