Skip to content
Sudheer edited this page Feb 15, 2023 · 36 revisions

Platform for running lua code in an asynchronous and event-driven manner. Much of the code is a fork from https://github.com/pocoproject/poco. Additional features are built on top of the base taken from pocoproject This module provides 2 components

  1. evlua: A standalone component to execute lua code in event-driven manner
  2. evluaserver: A HTTP(S) based server that listens to HTTP requests and hands them over to a lua script for processing

The components offer different features to an application

  1. Platform: A library that provides a set of API to access platform (os, std library) level functions
    1. Asynchronous FILE IO

    2. HTML Form handling (Server side / Request only)

    3. Server Side (incoming) request

    4. Server Side (outgoing) response

    5. Client-side (outgoing) request

    6. Client-side (incoming) response

    7. TCP/IP Sockets: Operations on stream sockets are supported as part of the platform module

      1. platform.debug_ss_ptr(tcp_conn)
      2. platform.get_sock_fd(ss)
      3. platform.close_tcp_connection(tcp_conn)
      4. platform.get_accepted_stream_socket()
      5. platform.make_tcp_connection(server_address, port_num, [timeout])
      6. platform.recv_data_from_socket(ss, buf, size, [timeout])
      7. platform.send_cms_on_socket(ss, cms)
      8. platform.send_data_on_acc_socket(ss, buf, size)
      9. platform.send_data_on_socket(ss, buf, size)
      10. platform.shutdown_websocket(ss, type)
      11. platform.socket_active(ss)
      12. platform.stop_tracking_conn_sock(ss)
      13. platform.track_ss_as_websocket(ss, [msg_handler])
    8. Websockets (The functions of this module are covered in the platform section)
      Both websocket client and websocket server are supported by this module. The module provides low level facilities to deal with web sockets, while the functionality of implementing the WEBSOCKET protocol is handled in lua by service_utils. The module "platform" exposes the following functions to handle operations on websocket
      platform.get_ws_recvd_msg_handler()
      platform.set_ws_recvd_msg_handler()
      platform.get_socket_upgrade_to()
      platform.set_socket_upgrade_to()
      platform.set_ws_recvd_msg_handler()
      platform.shutdown_websocket(ss, type)
      platform.track_ss_as_websocket(ss, [msg_handler])
      platform.websocket_active(ss)

  2. Socket connection pool
  3. Socket connection pool repository(evpoolrepos)
  4. TLS/SSL support (evlnetssl)
  5. Crypto library (evlcrypto)
  6. Postgresql interface for connections and statments (evpostgres)
  7. Sqlite interface for connections and statments (evsqlite)
  8. Redis interface for connections and data fetch and store (evredis)
  9. SMTP Client
    A module handle returned when the interface platform.mail_message_funcs is called
Clone this wiki locally