Questions tagged [tonic]

Tonic is an open source less is more, RESTful Web application development PHP library designed to do things "the right way", where resources are king and the library gets out of the way and leaves the developer to get on with it.

Tonic is an open source less is more, RESTful Web application development PHP library designed to do things "the right way", where resources are king and the library gets out of the way and leaves the developer to get on with it.

To understand Tonic, you need to get the Web, so forget everything you know for a minute and think about how the Web really works, it's not about HTML pages, it's about resources:

Everything useful is a resource, not a file, not a CGI script, a resource, an abstract concept of something useful that the client wants to grab hold of.

  • Resources are located by URLs, URLs are cheap and form the universal addressing system of the Web. Clients can issue a standard number of HTTP methods upon an infinite number of resources and receive something useful in return.
  • Representations of resources are sent back to the client, a representation is just a way of turning the abstract concept of a resource into something more concrete, like a HTML page or a XML file. One resource can have many different representations.
  • Tonic helps you develop Web applications that embrace the way the Web really works, enabling your applications to scale, extend and work with other systems easily.
30 questions
1
vote
0 answers

Apache 2.2 ignores .htaccess if Server Directory : {AllowOverride : None} and VirtualHost : { AllowOverride : all}

First of all, I'vre read every question about this kind of topic but except one of them, isn't replied. I have an Apache 2.2 Server Server |-foo |-bar |-piz |-target |-www |-rest_service And i'm implementing a PHP-REST Service on…
Ger Soto
  • 328
  • 2
  • 12
0
votes
0 answers

how validate request and pass data through async function in rust tonic

I wrote a service using rust tonic but I ran into some troubles. How do I conveniently validate requests generated by a protoc command?. I can't use some crates such as: validator (https://lib.rs/crates/validator_derive) because it's hard for me…
0
votes
1 answer

How can I get grpc status code in Rust tonic middleware

I've tried to implement a logging middleware for tonic Server that records elapse time, grpc status code, etc. I referred to https://tokio.rs/blog/2021-05-14-inventing-the-service-trait and…
0
votes
0 answers

how to borrow a struct obj to tonic grpc server function? global variable?

i use tonic grpc now, and this is server code, when a receive a grpc call(for example heart_beat request), it automatically execute async fn heart_beat . and i want save the request to a struct , so some other function can use it. but i don't how…
steve
  • 11
  • 2
0
votes
0 answers

Rust Tonic gRPC: Cannot access functions in generated file

Please, I have a microservice written in Rust that uses Tonic (gRPC) to access a SQL Server database. I have validated the versions and files, but I am unable to access the internal functions of the file generated by Tonic. I get the following error…
0
votes
0 answers

Reverse dial gRPC service with rust and tonic

I'm developing a set of gRPC microservices using rust and tonic library. One of those microservices is behind a firewall that does not allow any inbound connections. I'd like to know if it's still possible for this service to act as a server for…
Jacek Chmielewski
  • 1,763
  • 4
  • 16
  • 18
0
votes
1 answer

oneshot::channel `tokio::sync::oneshot::Receiver<()>` is not an iterator add `use futures_util::FutureExt`

In the tokio tests I see they use oneshot::channel together with serve_with_shutdown but the the compiler tells me to add use futures_util::future::future::FutureExt but as you can see in the example below I already added that trait to the…
Cesc
  • 904
  • 1
  • 9
  • 17
0
votes
0 answers

Rust: Tonic : gRPC : Tonic gRPC server is only handling one request at a time. Cannot handle multiple request at the same time

I have the following proto-buf and the server side code. When SayHello is resolving a long running task, it puts all other calls ( any SayHello or SayHello2 ) to the server on a queue. the other calls are only resolved when the 1st call is…
0
votes
1 answer

Cannot determine return type for grpc stream

I am trying to implement a simple stream rpc using tonic and grpc. I have been following the routeguide tutorial. When I try to return a tokio_stream::wrappers::ReceiverStream from my stream method I get compile error indicating I should return a…
Babbleshack
  • 341
  • 1
  • 5
  • 16
0
votes
0 answers

Creating a grpc client using tonic and rust

I’m trying to write a client to communicate with my grpc server written with tonic using Rust, but I’m having trouble understanding where to define and connect to the client, thus getting errors with my import statement. I’ve followed several…
AMP_035
  • 167
  • 1
  • 2
  • 13
0
votes
0 answers

Rust tonic Issue error `tonic::request::Request`, which does not implement the `Copy` trait

I am using tonic:2.0 for grpc implementation, I have created proto with service userdetails with message request username and user email as shown in below proto file with rust implementation. I am facing error when I use request request:…
nagaraj
  • 797
  • 1
  • 6
  • 29
0
votes
1 answer

nginx conf for tonic rest with multiple sites on mac

i try to config nginx with tonic rest for multiple sites on my mac. My nginx runs as localhost on my mac. My root is /Users/thorsten/Sites In root i habe some projects e.g. /project1, /project2 Each project has the tonic rest folder…
0
votes
1 answer

Tonic getElementById()

I'm trying to setup a code example on tonicdev.com for my open source react component hosted on Npm. Here's the code I'm trying to run (live edit on tonicdev.com here): var React = require('react'); var ReactDOM = require('react-dom'); var…
GavinoGrifoni
  • 743
  • 2
  • 12
  • 33
0
votes
2 answers

AngularJS $resource can't deserialized array into an object

I'm working with php Tonic and AngularJS. So I have angular that call a rest resource. The code of the rest is like this: /** * @method GET */ public function getData(){ $response = new Response(); $response->code = Response::OK; …
mrdaino
  • 331
  • 1
  • 4
  • 10
0
votes
1 answer

encode of REST parameter with "/" not working

I'm running a REST service on an URI likewise to localhost/1.0/json/host/:list/ where :list is the parameter to search for. The corresponding PHP function (using Tonic) public function get($list) { $list = urldecode($list); $list…
Ben Matheja
  • 115
  • 2
  • 2
  • 12
1
2